当前位置: 首页>>代码示例>>Java>>正文


Java TextUtils.equals方法代码示例

本文整理汇总了Java中android.text.TextUtils.equals方法的典型用法代码示例。如果您正苦于以下问题:Java TextUtils.equals方法的具体用法?Java TextUtils.equals怎么用?Java TextUtils.equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.text.TextUtils的用法示例。


在下文中一共展示了TextUtils.equals方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onNewIntent

import android.text.TextUtils; //导入方法依赖的package包/类
@Override
protected void onNewIntent(Intent intent) {
    if (intent == null) return;
    super.onNewIntent(intent);

    WebappInfo newWebappInfo = createWebappInfo(intent);
    if (newWebappInfo == null) {
        Log.e(TAG, "Failed to parse new Intent: " + intent);
        finish();
    } else if (!TextUtils.equals(mWebappInfo.id(), newWebappInfo.id())) {
        mWebappInfo = newWebappInfo;
        resetSavedInstanceState();
        if (mIsInitialized) initializeUI(null);
        // TODO(dominickn): send the web app into fullscreen if mDisplayMode is
        // WebDisplayMode.Fullscreen. See crbug.com/581522
    }
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:18,代码来源:WebappActivity.java

示例2: canSpliceBody

import android.text.TextUtils; //导入方法依赖的package包/类
private boolean canSpliceBody(Request request) {
    if (request == null) {
        return false;
    }
    if (!TextUtils.equals(request.method(), "POST")) {
        return false;
    }
    RequestBody body = request.body();
    if (body == null) {
        return true;
    }
    MediaType mediaType = body.contentType();
    if (mediaType == null) {
        return true;
    }
    if (TextUtils.equals(mediaType.subtype(), "multi-part")) {
        return false;
    }
    return true;
}
 
开发者ID:vsona,项目名称:RxJava2RetrofitDemo,代码行数:21,代码来源:ParamsInterceptor.java

示例3: a

import android.text.TextUtils; //导入方法依赖的package包/类
private boolean a(String str, Intent intent) {
    com.xiaomi.push.service.w.b b = w.a().b(str, intent.getStringExtra(y.p));
    boolean z = false;
    if (b == null || str == null) {
        return false;
    }
    Object stringExtra = intent.getStringExtra(y.B);
    String stringExtra2 = intent.getStringExtra(y.u);
    if (!(TextUtils.isEmpty(b.j) || TextUtils.equals(stringExtra, b.j))) {
        com.xiaomi.channel.commonutils.logger.b.a("session changed. old session=" + b.j + ", " +
                "new session=" + stringExtra);
        z = true;
    }
    if (stringExtra2.equals(b.i)) {
        return z;
    }
    com.xiaomi.channel.commonutils.logger.b.a("security changed. ");
    return true;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:20,代码来源:XMPushService.java

示例4: onException

import android.text.TextUtils; //导入方法依赖的package包/类
@Override
public void onException(NestedContainer container, String errCode, String msg) {
  if (TextUtils.equals(errCode, WXRenderErrorCode.WX_NETWORK_ERROR) && container instanceof WXEmbed) {
    final WXEmbed comp = ((WXEmbed)container);
    final ImageView imageView = new ImageView(comp.getContext());
    imageView.setImageResource(R.drawable.error);
    FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(ERROR_IMG_WIDTH, ERROR_IMG_HEIGHT);
    layoutParams.gravity = Gravity.CENTER;
    imageView.setLayoutParams(layoutParams);
    imageView.setScaleType(ImageView.ScaleType.FIT_XY);
    imageView.setAdjustViewBounds(true);
    imageView.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View v) {
        imageView.setOnClickListener(null);
        imageView.setEnabled(false);
        comp.loadContent();
      }
    });
    FrameLayout hostView = comp.getHostView();
    hostView.removeAllViews();
    hostView.addView(imageView);
    WXLogUtils.e("WXEmbed", "NetWork failure :" + errCode + ",\n error message :" + msg);
  }
}
 
开发者ID:weexext,项目名称:ucar-weex-core,代码行数:26,代码来源:WXEmbed.java

示例5: FirstPageCustomAdapter

import android.text.TextUtils; //导入方法依赖的package包/类
public FirstPageCustomAdapter(Context context, ItemTouchHelper helper, List<HomeBlock> list, TextView view, RecyclerView recyclerView) {
    this.mInflater = LayoutInflater.from(context);
    if (!BaseTypeUtils.isListEmpty(list)) {
        for (HomeBlock block : list) {
            if (block != null) {
                if (TextUtils.equals(block.isLock, "1")) {
                    this.mList.add(this.mLockSize, block);
                    this.mLockSize++;
                } else {
                    this.mList.add(block);
                }
            }
        }
        this.mItemTouchHelper = helper;
        this.mContext = context;
        if (this.mLockSize == 0) {
            this.mHeadSize = 1;
        } else {
            this.mHeadSize = 2;
        }
        this.mSaveView = view;
        this.mRecyclerView = recyclerView;
    }
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:25,代码来源:FirstPageCustomAdapter.java

示例6: isTokenInvalid

import android.text.TextUtils; //导入方法依赖的package包/类
public boolean isTokenInvalid(JSONObject object) {
    if (isChatRoomTokenInvalid(object) || isHotPointTokenInvalid(object) || isPlayRecordTokenInvalid(object) || isCommentTokenInvalid(object) || isCreditTokenInvalid(object)) {
        return true;
    }
    String errorCode = object.optString("errorCode");
    if (TextUtils.isEmpty(errorCode)) {
        return false;
    }
    if (TextUtils.equals(errorCode, "1002") && object.has("action") && TextUtils.isEmpty(object.optString("action"))) {
        return true;
    }
    if (TextUtils.equals(errorCode, ERROR_CODE_1014) || TextUtils.equals(errorCode, ERROR_CODE_1020)) {
        return true;
    }
    return false;
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:17,代码来源:LetvBaseParser.java

示例7: equals

import android.text.TextUtils; //导入方法依赖的package包/类
@Override
public boolean equals(Object obj) {
    if (obj == this) {
        return true;
    }
    if (!(obj instanceof RemoteVideoInfo)) {
        return false;
    }

    RemoteVideoInfo other = (RemoteVideoInfo) obj;
    return durationMillis == other.durationMillis
           && currentTimeMillis == other.currentTimeMillis
           && state == other.state
           && TextUtils.equals(title, other.title)
           && TextUtils.equals(errorMessage, other.errorMessage);
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:17,代码来源:RemoteVideoInfo.java

示例8: beforeInvoke

import android.text.TextUtils; //导入方法依赖的package包/类
@Override
protected boolean beforeInvoke(Object receiver, Method method, Object[] args) throws Throwable {
    //callingPackage
    final int index = 0;
    if (args != null && args.length > index && args[index] instanceof String) {
        String callingPackage = (String) args[index];
        if (!TextUtils.equals(callingPackage, mHostContext.getPackageName())) {
            args[index] = mHostContext.getPackageName();
        }
    }
    return super.beforeInvoke(receiver, method, args);
}
 
开发者ID:amikey,项目名称:DroidPlugin,代码行数:13,代码来源:IWifiManagerHookHandle.java

示例9: forceAlert

import android.text.TextUtils; //导入方法依赖的package包/类
private void forceAlert() {
    boolean isOpen = TextUtils.equals("1", TipUtils.getTipTitle(DialogMsgConstantId.CONSTANT_90006, "0"));
    if (isOpen) {
        String lastLaunchDate = PreferencesManager.getInstance().getLatestLaunchDate();
        LogInfo.log("save_", "最后一起启动app的日期为:" + lastLaunchDate);
        if (TextUtils.isEmpty(lastLaunchDate)) {
            PreferencesManager.getInstance().saveLatestLaunchTime();
            return;
        }
        String nowDate = StringUtils.timeString(System.currentTimeMillis());
        String nowMinute = StringUtils.timeClockString();
        int dateBetween = 0;
        try {
            dateBetween = StringUtils.daysBetween(lastLaunchDate, nowDate);
        } catch (Exception e) {
            e.printStackTrace();
        }
        LogInfo.log("save_", "强制弹框日期应为:" + lastLaunchDate + " + " + Integer.valueOf(PreferencesManager.getInstance().getCurrentForceAlertDistanceDays()));
        if (dateBetween >= Integer.valueOf(PreferencesManager.getInstance().getCurrentForceAlertDistanceDays()).intValue()) {
            int minuteBetween = 0;
            try {
                minuteBetween = StringUtils.calMinuteBetween(TipUtils.getTipMessage(DialogMsgConstantId.CONSTANT_90005, "16:00"), nowMinute);
            } catch (Exception e2) {
                e2.printStackTrace();
            }
            if (minuteBetween <= PreferencesManager.getInstance().getPushDistance() / 60) {
                DialogService.launch(this, DialogType.TYPE_FORCE_ALERT_OPEN, TipUtils.getTipTitle(DialogMsgConstantId.CONSTANT_90004, 2131100136), TipUtils.getTipMessage(DialogMsgConstantId.CONSTANT_90004, 2131100134));
                showForceLocalNotification(TipUtils.getTipMessage(DialogMsgConstantId.CONSTANT_90004, 2131100134));
                LogInfo.log("save_", "minuteBetween = " + minuteBetween + " , show force dialog");
                return;
            }
            LogInfo.log("save_", " minuteBetween = " + minuteBetween + " , saved alerttime is = " + TipUtils.getTipMessage(DialogMsgConstantId.CONSTANT_90005, "16:00"));
            return;
        }
        LogInfo.log("save_", " dateBetween = " + dateBetween + " , saved current distance = " + Integer.valueOf(PreferencesManager.getInstance().getCurrentForceAlertDistanceDays()));
        return;
    }
    LogInfo.log("save_", "强制弹框开关为:" + isOpen);
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:40,代码来源:LetvPushService.java

示例10: onTorchModeUnavailable

import android.text.TextUtils; //导入方法依赖的package包/类
@Override
public void onTorchModeUnavailable(String cameraId) {
    if (DEBUG) Log.d(TAG, "onTorchModeUnavailable: cameraId=" + cameraId);
    if (TextUtils.equals(cameraId, getCameraId())) {
        resetTimeout();
        mTorchStatus = TORCH_STATUS_ERROR;
        maybeProcessStartIntent();
        TorchService.this.stopForeground(true);
        broadcastStatus();
        stopSelf();
    }
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:13,代码来源:TorchService.java

示例11: getInitialUrlForDocument

import android.text.TextUtils; //导入方法依赖的package包/类
/**
 * Parse out the URL for a document Intent.
 * @param intent Intent to check.
 * @return The URL that the Intent was fired to display, or null if it couldn't be retrieved.
 */
public static String getInitialUrlForDocument(Intent intent) {
    if (intent == null || intent.getData() == null) return null;
    Uri data = intent.getData();
    return TextUtils.equals(data.getScheme(), UrlConstants.DOCUMENT_SCHEME)
            ? data.getQuery() : null;
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:12,代码来源:ActivityDelegate.java

示例12: a

import android.text.TextUtils; //导入方法依赖的package包/类
private boolean a(String str) {
    if (TextUtils.isEmpty(str) || str.startsWith(TimeLinePatterns.WEB_SCHEME) || str.startsWith("https://")) {
        return false;
    }
    if (!"SDKLite://h5quit".equalsIgnoreCase(str)) {
        if (TextUtils.equals(str, this.d)) {
            str = str + "?resultCode=150";
        }
        h.a((Activity) this, str);
    }
    finish();
    return true;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:14,代码来源:AuthActivity.java

示例13: withPreferredAudioLanguage

import android.text.TextUtils; //导入方法依赖的package包/类
/**
 * Returns a {@link Parameters} instance with the provided preferred language for audio and
 * forced text tracks.
 *
 * @param preferredAudioLanguage The preferred language as defined by RFC 5646. {@code null} to
 *     select the default track, or first track if there's no default.
 * @return A {@link Parameters} instance with the provided preferred language for audio and
 *     forced text tracks.
 */
public Parameters withPreferredAudioLanguage(String preferredAudioLanguage) {
  preferredAudioLanguage = Util.normalizeLanguageCode(preferredAudioLanguage);
  if (TextUtils.equals(preferredAudioLanguage, this.preferredAudioLanguage)) {
    return this;
  }
  return new Parameters(preferredAudioLanguage, preferredTextLanguage,
      allowMixedMimeAdaptiveness, allowNonSeamlessAdaptiveness, maxVideoWidth, maxVideoHeight,
      maxVideoBitrate, exceedVideoConstraintsIfNecessary, exceedRendererCapabilitiesIfNecessary,
      viewportWidth, viewportHeight, orientationMayChange);
}
 
开发者ID:sanjaysingh1990,项目名称:Exoplayer2Radio,代码行数:20,代码来源:DefaultTrackSelector.java

示例14: getBooleanParam

import android.text.TextUtils; //导入方法依赖的package包/类
/**
 * Gets a boolean Finch parameter, assuming the <paramName>="true" format.  Also checks for a
 * command-line switch with the same name, for easy local testing.
 * @param paramName The name of the Finch parameter (or command-line switch) to get a value for.
 * @return Whether the Finch param is defined with a value "true", if there's a command-line
 *         flag present with any value.
 */
private static boolean getBooleanParam(String paramName) {
    if (CommandLine.getInstance().hasSwitch(paramName)) {
        return true;
    }
    return TextUtils.equals(ENABLED_VALUE,
            VariationsAssociatedData.getVariationParamValue(FIELD_TRIAL_NAME, paramName));
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:15,代码来源:ContextualSearchFieldTrial.java

示例15: refreshView

import android.text.TextUtils; //导入方法依赖的package包/类
private void refreshView(LTStarRankModelPB result) {
    if (result == null || BaseTypeUtils.isListEmpty(result.data)) {
        LogInfo.log("zhaoxiang", System.currentTimeMillis() + "");
        showTitleView(false);
        this.mRootView.dataError(false);
        return;
    }
    showTitleView(true);
    this.mRootView.finishLayout();
    this.mLoadingView.clearAnimation();
    this.mLoadingView.setVisibility(8);
    this.mIsRefrence = false;
    if (this.mStarRankAdapter == null) {
        this.mStarRankAdapter = new StarRankAdapter(this.mContext);
    }
    if (this.oldStarRank != null) {
        if (TextUtils.equals(result.is_rank, "1")) {
            this.oldStarRank.setVisibility(0);
        } else {
            this.oldStarRank.setVisibility(8);
        }
    }
    if (BaseTypeUtils.getElementFromList(result.data, 0) != null) {
        addHeadView((LTStarRankModelDetailPB) result.data.get(0));
    }
    this.mListView.setAdapter(this.mStarRankAdapter);
    this.mStarRankAdapter.setList((ExpandableListView) this.mListView.getRootView(), result.data);
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:29,代码来源:StarRankActivity.java


注:本文中的android.text.TextUtils.equals方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。