android.support.v4.content.IntentCompat源码实例Demo

类android.support.v4.content.IntentCompat源码实例Demo

下面列出了android.support.v4.content.IntentCompat 类实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: MiBandDecompiled   文件: NavUtils.java
public static Intent getParentActivityIntent(Context context, ComponentName componentname)
{
    String s = getParentActivityName(context, componentname);
    if (s == null)
    {
        return null;
    }
    ComponentName componentname1 = new ComponentName(componentname.getPackageName(), s);
    if (getParentActivityName(context, componentname1) == null)
    {
        return IntentCompat.makeMainActivity(componentname1);
    } else
    {
        return (new Intent()).setComponent(componentname1);
    }
}
 
源代码2 项目: MiBandDecompiled   文件: NavUtils.java
public static Intent getParentActivityIntent(Context context, Class class1)
{
    String s = getParentActivityName(context, new ComponentName(context, class1));
    if (s == null)
    {
        return null;
    }
    ComponentName componentname = new ComponentName(context, s);
    if (getParentActivityName(context, componentname) == null)
    {
        return IntentCompat.makeMainActivity(componentname);
    } else
    {
        return (new Intent()).setComponent(componentname);
    }
}
 
源代码3 项目: CodenameOne   文件: TaskStackBuilder.java
/**
 * Start the task stack constructed by this builder. The Context used to obtain
 * this builder must be an Activity.
 *
 * <p>On devices that do not support API level 11 or higher the topmost activity
 * will be started as a new task. On devices that do support API level 11 or higher
 * the new task stack will be created in its entirety.</p>
 *
 * @param options Additional options for how the Activity should be started.
 * See {@link android.content.Context#startActivity(Intent, Bundle)
 */
public void startActivities(Bundle options) {
    if (mIntents.isEmpty()) {
        throw new IllegalStateException(
                "No intents added to TaskStackBuilder; cannot startActivities");
    }

    Intent[] intents = mIntents.toArray(new Intent[mIntents.size()]);
    intents[0] = new Intent(intents[0]).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
            IntentCompat.FLAG_ACTIVITY_CLEAR_TASK |
            IntentCompat.FLAG_ACTIVITY_TASK_ON_HOME);
    if (!ContextCompat.startActivities(mSourceContext, intents, options)) {
        Intent topIntent = new Intent(intents[intents.length - 1]);
        topIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        mSourceContext.startActivity(topIntent);
    }
}
 
源代码4 项目: CodenameOne   文件: NavUtils.java
@Override
public Intent getParentActivityIntent(Activity activity) {
    String parentName = NavUtils.getParentActivityName(activity);
    if (parentName == null) return null;

    // If the parent itself has no parent, generate a main activity intent.
    final ComponentName target = new ComponentName(activity, parentName);
    try {
        final String grandparent = NavUtils.getParentActivityName(activity, target);
        final Intent parentIntent = grandparent == null
                ? IntentCompat.makeMainActivity(target)
                : new Intent().setComponent(target);
        return parentIntent;
    } catch (NameNotFoundException e) {
        Log.e(TAG, "getParentActivityIntent: bad parentActivityName '" + parentName +
                "' in manifest");
        return null;
    }
}
 
源代码5 项目: adt-leanback-support   文件: TaskStackBuilder.java
/**
 * Start the task stack constructed by this builder. The Context used to obtain
 * this builder must be an Activity.
 *
 * <p>On devices that do not support API level 11 or higher the topmost activity
 * will be started as a new task. On devices that do support API level 11 or higher
 * the new task stack will be created in its entirety.</p>
 *
 * @param options Additional options for how the Activity should be started.
 * See {@link android.content.Context#startActivity(Intent, Bundle)
 */
public void startActivities(Bundle options) {
    if (mIntents.isEmpty()) {
        throw new IllegalStateException(
                "No intents added to TaskStackBuilder; cannot startActivities");
    }

    Intent[] intents = mIntents.toArray(new Intent[mIntents.size()]);
    intents[0] = new Intent(intents[0]).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
            IntentCompat.FLAG_ACTIVITY_CLEAR_TASK |
            IntentCompat.FLAG_ACTIVITY_TASK_ON_HOME);
    if (!ContextCompat.startActivities(mSourceContext, intents, options)) {
        Intent topIntent = new Intent(intents[intents.length - 1]);
        topIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        mSourceContext.startActivity(topIntent);
    }
}
 
源代码6 项目: adt-leanback-support   文件: NavUtils.java
@Override
public Intent getParentActivityIntent(Activity activity) {
    String parentName = NavUtils.getParentActivityName(activity);
    if (parentName == null) return null;

    // If the parent itself has no parent, generate a main activity intent.
    final ComponentName target = new ComponentName(activity, parentName);
    try {
        final String grandparent = NavUtils.getParentActivityName(activity, target);
        final Intent parentIntent = grandparent == null
                ? IntentCompat.makeMainActivity(target)
                : new Intent().setComponent(target);
        return parentIntent;
    } catch (NameNotFoundException e) {
        Log.e(TAG, "getParentActivityIntent: bad parentActivityName '" + parentName +
                "' in manifest");
        return null;
    }
}
 
源代码7 项目: android-recipes-app   文件: TaskStackBuilder.java
/**
 * Start the task stack constructed by this builder. The Context used to obtain
 * this builder must be an Activity.
 *
 * <p>On devices that do not support API level 11 or higher the topmost activity
 * will be started as a new task. On devices that do support API level 11 or higher
 * the new task stack will be created in its entirety.</p>
 *
 * @param options Additional options for how the Activity should be started.
 * See {@link android.content.Context#startActivity(Intent, Bundle)
 */
public void startActivities(Bundle options) {
    if (mIntents.isEmpty()) {
        throw new IllegalStateException(
                "No intents added to TaskStackBuilder; cannot startActivities");
    }

    Intent[] intents = mIntents.toArray(new Intent[mIntents.size()]);
    intents[0] = new Intent(intents[0]).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
            IntentCompat.FLAG_ACTIVITY_CLEAR_TASK |
            IntentCompat.FLAG_ACTIVITY_TASK_ON_HOME);
    if (!ContextCompat.startActivities(mSourceContext, intents, options)) {
        Intent topIntent = new Intent(intents[intents.length - 1]);
        topIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        mSourceContext.startActivity(topIntent);
    }
}
 
源代码8 项目: android-recipes-app   文件: NavUtils.java
@Override
public Intent getParentActivityIntent(Activity activity) {
    String parentName = NavUtils.getParentActivityName(activity);
    if (parentName == null) return null;

    // If the parent itself has no parent, generate a main activity intent.
    final ComponentName target = new ComponentName(activity, parentName);
    try {
        final String grandparent = NavUtils.getParentActivityName(activity, target);
        final Intent parentIntent = grandparent == null
                ? IntentCompat.makeMainActivity(target)
                : new Intent().setComponent(target);
        return parentIntent;
    } catch (NameNotFoundException e) {
        Log.e(TAG, "getParentActivityIntent: bad parentActivityName '" + parentName +
                "' in manifest");
        return null;
    }
}
 
源代码9 项目: V.FlyoutTest   文件: TaskStackBuilder.java
/**
 * Start the task stack constructed by this builder. The Context used to obtain
 * this builder must be an Activity.
 *
 * <p>On devices that do not support API level 11 or higher the topmost activity
 * will be started as a new task. On devices that do support API level 11 or higher
 * the new task stack will be created in its entirety.</p>
 *
 * @param options Additional options for how the Activity should be started.
 * See {@link android.content.Context#startActivity(Intent, Bundle)
 */
public void startActivities(Bundle options) {
    if (mIntents.isEmpty()) {
        throw new IllegalStateException(
                "No intents added to TaskStackBuilder; cannot startActivities");
    }

    Intent[] intents = mIntents.toArray(new Intent[mIntents.size()]);
    intents[0] = new Intent(intents[0]).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
            IntentCompat.FLAG_ACTIVITY_CLEAR_TASK |
            IntentCompat.FLAG_ACTIVITY_TASK_ON_HOME);
    if (!ContextCompat.startActivities(mSourceContext, intents, options)) {
        Intent topIntent = new Intent(intents[intents.length - 1]);
        topIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        mSourceContext.startActivity(topIntent);
    }
}
 
源代码10 项目: V.FlyoutTest   文件: NavUtils.java
@Override
public Intent getParentActivityIntent(Activity activity) {
    String parentName = NavUtils.getParentActivityName(activity);
    if (parentName == null) return null;

    // If the parent itself has no parent, generate a main activity intent.
    final ComponentName target = new ComponentName(activity, parentName);
    try {
        final String grandparent = NavUtils.getParentActivityName(activity, target);
        final Intent parentIntent = grandparent == null
                ? IntentCompat.makeMainActivity(target)
                : new Intent().setComponent(target);
        return parentIntent;
    } catch (NameNotFoundException e) {
        Log.e(TAG, "getParentActivityIntent: bad parentActivityName '" + parentName +
                "' in manifest");
        return null;
    }
}
 
源代码11 项目: guideshow   文件: TaskStackBuilder.java
/**
 * Start the task stack constructed by this builder. The Context used to obtain
 * this builder must be an Activity.
 *
 * <p>On devices that do not support API level 11 or higher the topmost activity
 * will be started as a new task. On devices that do support API level 11 or higher
 * the new task stack will be created in its entirety.</p>
 *
 * @param options Additional options for how the Activity should be started.
 * See {@link android.content.Context#startActivity(Intent, Bundle)
 */
public void startActivities(Bundle options) {
    if (mIntents.isEmpty()) {
        throw new IllegalStateException(
                "No intents added to TaskStackBuilder; cannot startActivities");
    }

    Intent[] intents = mIntents.toArray(new Intent[mIntents.size()]);
    intents[0] = new Intent(intents[0]).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
            IntentCompat.FLAG_ACTIVITY_CLEAR_TASK |
            IntentCompat.FLAG_ACTIVITY_TASK_ON_HOME);
    if (!ContextCompat.startActivities(mSourceContext, intents, options)) {
        Intent topIntent = new Intent(intents[intents.length - 1]);
        topIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        mSourceContext.startActivity(topIntent);
    }
}
 
源代码12 项目: guideshow   文件: NavUtils.java
@Override
public Intent getParentActivityIntent(Activity activity) {
    String parentName = NavUtils.getParentActivityName(activity);
    if (parentName == null) return null;

    // If the parent itself has no parent, generate a main activity intent.
    final ComponentName target = new ComponentName(activity, parentName);
    try {
        final String grandparent = NavUtils.getParentActivityName(activity, target);
        final Intent parentIntent = grandparent == null
                ? IntentCompat.makeMainActivity(target)
                : new Intent().setComponent(target);
        return parentIntent;
    } catch (NameNotFoundException e) {
        Log.e(TAG, "getParentActivityIntent: bad parentActivityName '" + parentName +
                "' in manifest");
        return null;
    }
}
 
源代码13 项目: secrecy   文件: SettingsFragment.java
private void confirm_stealth(String password) {
    final View dialogView = View.inflate(context, R.layout.dialog_confirm_stealth, null);
    ((TextView) dialogView
            .findViewById(R.id.stealth_keycode))
            .append(password);
    new AlertDialog.Builder(context)
            .setInverseBackgroundForced(true)
            .setView(dialogView)
            .setMessage(R.string.Settings__try_once_before_hide)
            .setPositiveButton(getString(R.string.OK), new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int which) {
                    SharedPreferences.Editor editor
                            = PreferenceManager.getDefaultSharedPreferences(context).edit();
                    editor.putBoolean(Config.SHOW_STEALTH_MODE_TUTORIAL, true);
                    editor.apply();
                    Intent dial = new Intent();
                    dial.setAction("android.intent.action.DIAL");
                    dial.setData(Uri.parse("tel:"));
                    dial.setFlags(IntentCompat.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
                    startActivity(dial);
                    getActivity().finish();
                }
            })
            .show();
}
 
源代码14 项目: secrecy   文件: OutgoingCallReceiver.java
@Override
public void onReceive(final Context context, Intent intent) {

    // Gets the intent, check if it matches our secret code
    if (Intent.ACTION_NEW_OUTGOING_CALL.equals(intent.getAction()) &&
            intent.getExtras() != null) {
        Intent launcher = new Intent(context, MainActivity.class);
        //These flags are added to make the new mainActivity in the home stack.
        //i.e. back button returns to home not dialer.
        launcher.addFlags(IntentCompat.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK | IntentCompat.FLAG_ACTIVITY_TASK_ON_HOME);
        String phoneNumber = intent.getExtras().getString(android.content.Intent.EXTRA_PHONE_NUMBER);
        String openPin = PreferenceManager.getDefaultSharedPreferences(context)
                .getString(Config.STEALTH_MODE_PASSWORD, "");
        if (!openPin.equals("")) {
            if (("*#" + openPin).equals(phoneNumber)) {
                // Launch the main app!!
                launchActivity(context, launcher);
            }
        }
    }
}
 
源代码15 项目: letv   文件: ShareCompat.java
public IntentBuilder setHtmlText(String htmlText) {
    this.mIntent.putExtra(IntentCompat.EXTRA_HTML_TEXT, htmlText);
    if (!this.mIntent.hasExtra("android.intent.extra.TEXT")) {
        setText(Html.fromHtml(htmlText));
    }
    return this;
}
 
源代码16 项目: letv   文件: ShareCompat.java
public String getHtmlText() {
    String result = this.mIntent.getStringExtra(IntentCompat.EXTRA_HTML_TEXT);
    if (result != null) {
        return result;
    }
    CharSequence text = getText();
    if (text instanceof Spanned) {
        return Html.toHtml((Spanned) text);
    }
    if (text != null) {
        return ShareCompat.IMPL.escapeHtml(text);
    }
    return result;
}
 
源代码17 项目: letv   文件: NavUtils.java
public Intent getParentActivityIntent(Activity activity) {
    Intent intent = null;
    String parentName = NavUtils.getParentActivityName(activity);
    if (parentName != null) {
        ComponentName target = new ComponentName(activity, parentName);
        try {
            intent = NavUtils.getParentActivityName(activity, target) == null ? IntentCompat.makeMainActivity(target) : new Intent().setComponent(target);
        } catch (NameNotFoundException e) {
            Log.e(NavUtils.TAG, "getParentActivityIntent: bad parentActivityName '" + parentName + "' in manifest");
        }
    }
    return intent;
}
 
源代码18 项目: letv   文件: NavUtils.java
public static Intent getParentActivityIntent(Context context, Class<?> sourceActivityClass) throws NameNotFoundException {
    String parentActivity = getParentActivityName(context, new ComponentName(context, sourceActivityClass));
    if (parentActivity == null) {
        return null;
    }
    ComponentName target = new ComponentName(context, parentActivity);
    return getParentActivityName(context, target) == null ? IntentCompat.makeMainActivity(target) : new Intent().setComponent(target);
}
 
源代码19 项目: letv   文件: NavUtils.java
public static Intent getParentActivityIntent(Context context, ComponentName componentName) throws NameNotFoundException {
    String parentActivity = getParentActivityName(context, componentName);
    if (parentActivity == null) {
        return null;
    }
    ComponentName target = new ComponentName(componentName.getPackageName(), parentActivity);
    return getParentActivityName(context, target) == null ? IntentCompat.makeMainActivity(target) : new Intent().setComponent(target);
}
 
源代码20 项目: Gallery-example   文件: SettingsActivity.java
static void restartApp(Activity activity) {
    Intent newIntent = new Intent(activity, MainActivity.class);
    newIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | IntentCompat.FLAG_ACTIVITY_CLEAR_TASK);
    activity.startActivity(newIntent);
    activity.overridePendingTransition(0, 0);
    activity.finish();
}
 
源代码21 项目: Color-picker-library   文件: PreferenceActivity.java
private void restartApp() {
    Intent newIntent = new Intent(getActivity(), MainActivity.class);
    newIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | IntentCompat.FLAG_ACTIVITY_CLEAR_TASK);
    startActivity(newIntent);
    getActivity().overridePendingTransition(0, 0);
    getActivity().finish();
}
 
源代码22 项目: datmusic-android   文件: IntentManager.java
public void openIntentWithClear(Intent intent) {
    ComponentName cn = intent.getComponent();
    Intent mainIntent = IntentCompat.makeRestartActivityTask(cn);
    mContext.startActivity(mainIntent);
    try {
        ((Activity) mContext).finish();
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
源代码23 项目: CodenameOne   文件: ShareCompat.java
/**
 * Get the styled HTML text shared with the target activity.
 * If no HTML text was supplied but {@link Intent#EXTRA_TEXT} contained
 * styled text, it will be converted to HTML if possible and returned.
 * If the text provided by {@link Intent#EXTRA_TEXT} was not styled text,
 * it will be escaped by {@link android.text.Html#escapeHtml(CharSequence)}
 * and returned. If no text was provided at all, this method will return null.
 *
 * @return Styled text provided by the sender as HTML.
 */
public String getHtmlText() {
    String result = mIntent.getStringExtra(IntentCompat.EXTRA_HTML_TEXT);
    if (mIntent == null) {
        CharSequence text = getText();
        if (text instanceof Spanned) {
            result = Html.toHtml((Spanned) text);
        } else if (text != null) {
            result = IMPL.escapeHtml(text);
        }
    }
    return result;
}
 
源代码24 项目: CodenameOne   文件: TaskStackBuilder.java
public PendingIntent getPendingIntent(Context context, Intent[] intents, int requestCode,
        int flags, Bundle options) {
    intents[0] = new Intent(intents[0]).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
            IntentCompat.FLAG_ACTIVITY_CLEAR_TASK |
            IntentCompat.FLAG_ACTIVITY_TASK_ON_HOME);
    return TaskStackBuilderHoneycomb.getActivitiesPendingIntent(context, requestCode,
            intents, flags);
}
 
源代码25 项目: CodenameOne   文件: TaskStackBuilder.java
public PendingIntent getPendingIntent(Context context, Intent[] intents, int requestCode,
        int flags, Bundle options) {
    intents[0] = new Intent(intents[0]).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
            IntentCompat.FLAG_ACTIVITY_CLEAR_TASK |
            IntentCompat.FLAG_ACTIVITY_TASK_ON_HOME);
    return TaskStackBuilderJellybean.getActivitiesPendingIntent(context, requestCode,
            intents, flags, options);
}
 
源代码26 项目: CodenameOne   文件: TaskStackBuilder.java
/**
 * Obtain a {@link PendingIntent} for launching the task constructed by this builder so far.
 *
 * @param requestCode Private request code for the sender
 * @param flags May be {@link PendingIntent#FLAG_ONE_SHOT},
 *              {@link PendingIntent#FLAG_NO_CREATE}, {@link PendingIntent#FLAG_CANCEL_CURRENT},
 *              {@link PendingIntent#FLAG_UPDATE_CURRENT}, or any of the flags supported by
 *              {@link Intent#fillIn(Intent, int)} to control which unspecified parts of the
 *              intent that can be supplied when the actual send happens.
 * @param options Additional options for how the Activity should be started.
 * See {@link android.content.Context#startActivity(Intent, Bundle)
 * @return The obtained PendingIntent
 */
public PendingIntent getPendingIntent(int requestCode, int flags, Bundle options) {
    if (mIntents.isEmpty()) {
        throw new IllegalStateException(
                "No intents added to TaskStackBuilder; cannot getPendingIntent");
    }

    Intent[] intents = mIntents.toArray(new Intent[mIntents.size()]);
    intents[0] = new Intent(intents[0]).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
            IntentCompat.FLAG_ACTIVITY_CLEAR_TASK |
            IntentCompat.FLAG_ACTIVITY_TASK_ON_HOME);
    // Appropriate flags will be added by the call below.
    return IMPL.getPendingIntent(mSourceContext, intents, requestCode, flags, options);
}
 
源代码27 项目: CodenameOne   文件: TaskStackBuilder.java
/**
 * Return an array containing the intents added to this builder. The intent at the
 * root of the task stack will appear as the first item in the array and the
 * intent at the top of the stack will appear as the last item.
 *
 * @return An array containing the intents added to this builder.
 */
public Intent[] getIntents() {
    Intent[] intents = new Intent[mIntents.size()];
    if (intents.length == 0) return intents;

    intents[0] = new Intent(mIntents.get(0)).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
            IntentCompat.FLAG_ACTIVITY_CLEAR_TASK |
            IntentCompat.FLAG_ACTIVITY_TASK_ON_HOME);
    for (int i = 1; i < intents.length; i++) {
        intents[i] = new Intent(mIntents.get(i));
    }
    return intents;
}
 
源代码28 项目: CodenameOne   文件: NavUtils.java
/**
 * Obtain an {@link Intent} that will launch an explicit target activity
 * specified by sourceActivityClass's {@link #PARENT_ACTIVITY} &lt;meta-data&gt;
 * element in the application's manifest.
 *
 * @param context Context for looking up the activity component for sourceActivityClass
 * @param sourceActivityClass {@link java.lang.Class} object for an Activity class
 * @return a new Intent targeting the defined parent activity of sourceActivity
 * @throws NameNotFoundException if the ComponentName for sourceActivityClass is invalid
 */
public static Intent getParentActivityIntent(Context context, Class<?> sourceActivityClass)
        throws NameNotFoundException {
    String parentActivity = getParentActivityName(context,
            new ComponentName(context, sourceActivityClass));
    if (parentActivity == null) return null;

    // If the parent itself has no parent, generate a main activity intent.
    final ComponentName target = new ComponentName(context, parentActivity);
    final String grandparent = getParentActivityName(context, target);
    final Intent parentIntent = grandparent == null
            ? IntentCompat.makeMainActivity(target)
            : new Intent().setComponent(target);
    return parentIntent;
}
 
源代码29 项目: CodenameOne   文件: NavUtils.java
/**
 * Obtain an {@link Intent} that will launch an explicit target activity
 * specified by sourceActivityClass's {@link #PARENT_ACTIVITY} &lt;meta-data&gt;
 * element in the application's manifest.
 *
 * @param context Context for looking up the activity component for the source activity
 * @param componentName ComponentName for the source Activity
 * @return a new Intent targeting the defined parent activity of sourceActivity
 * @throws NameNotFoundException if the ComponentName for sourceActivityClass is invalid
 */
public static Intent getParentActivityIntent(Context context, ComponentName componentName)
        throws NameNotFoundException {
    String parentActivity = getParentActivityName(context, componentName);
    if (parentActivity == null) return null;

    // If the parent itself has no parent, generate a main activity intent.
    final ComponentName target = new ComponentName(
            componentName.getPackageName(), parentActivity);
    final String grandparent = getParentActivityName(context, target);
    final Intent parentIntent = grandparent == null
            ? IntentCompat.makeMainActivity(target)
            : new Intent().setComponent(target);
    return parentIntent;
}
 
源代码30 项目: adt-leanback-support   文件: ShareCompat.java
/**
 * Get the styled HTML text shared with the target activity.
 * If no HTML text was supplied but {@link Intent#EXTRA_TEXT} contained
 * styled text, it will be converted to HTML if possible and returned.
 * If the text provided by {@link Intent#EXTRA_TEXT} was not styled text,
 * it will be escaped by {@link android.text.Html#escapeHtml(CharSequence)}
 * and returned. If no text was provided at all, this method will return null.
 *
 * @return Styled text provided by the sender as HTML.
 */
public String getHtmlText() {
    String result = mIntent.getStringExtra(IntentCompat.EXTRA_HTML_TEXT);
    if (result == null) {
        CharSequence text = getText();
        if (text instanceof Spanned) {
            result = Html.toHtml((Spanned) text);
        } else if (text != null) {
            result = IMPL.escapeHtml(text);
        }
    }
    return result;
}