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


Java Intent.getCharSequenceExtra方法代码示例

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


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

示例1: onHandleIntent

import android.content.Intent; //导入方法依赖的package包/类
@Override
protected void onHandleIntent(Intent intent) {
    if (intent == null) {
        return;
    }
    final String action = intent.getAction();
    if (ACTION_UPDATE_ICON.equals(action)) {
        ResultReceiver receiver = intent.getParcelableExtra(Intent.EXTRA_RESULT_RECEIVER);
        handleUpdateIcon(receiver);
    } else if (ACTION_REPLY.equals(action)) {
        CharSequence content = intent.getCharSequenceExtra(EXTRA_CONTENT);
        Chat chat = intent.getParcelableExtra(EXTRA_CHAT);
        handleReply(content, chat);
    } else if (ACTION_DOWNLOAD_QRCODE.equals(action)) {
        handleDownloadQrCode();
    } else if (ACTION_RESTART_WEBQQ.equals(action)) {
        handleRestart();
    }
}
 
开发者ID:RikkaApps,项目名称:FCM-for-Mojo,代码行数:20,代码来源:FFMIntentService.java

示例2: onActivityResult

import android.content.Intent; //导入方法依赖的package包/类
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (resultCode == 0 && data != null) {
        CharSequence text = data.getCharSequenceExtra(EditorActivity.TEXT_INTENT);
        if (text != null) {
            mCodeViews.get(mSettings.get(requestCode)).resetTest();
            mCodeViews.get(mSettings.get(requestCode)).setCode(text.toString().trim());
            showFab();
        }
    }
}
 
开发者ID:morogoku,项目名称:MTweaks-KernelAdiutorMOD,代码行数:13,代码来源:CreateFragment.java

示例3: onCreate

import android.content.Intent; //导入方法依赖的package包/类
@SuppressLint("MissingSuperCall")
@Override
protected void onCreate(Bundle savedInstanceState) {
    Intent intent = getIntent();
    int userId = intent.getIntExtra(Constants.EXTRA_USER_HANDLE, VUserHandle.getCallingUserId());
    mOptions = intent.getParcelableExtra(EXTRA_DATA);
    mResultWho = intent.getStringExtra(EXTRA_WHO);
    mRequestCode = intent.getIntExtra(EXTRA_REQUEST_CODE, 0);
    Parcelable targetParcelable = intent.getParcelableExtra(Intent.EXTRA_INTENT);
    if (!(targetParcelable instanceof Intent)) {
        VLog.w("ChooseActivity", "Target is not an intent: " + targetParcelable);
        finish();
        return;
    }
    Intent target = (Intent) targetParcelable;
    CharSequence title = intent.getCharSequenceExtra(Intent.EXTRA_TITLE);
    if (title == null) {
        title = getString(R.string.choose);
    }
    Parcelable[] pa = intent.getParcelableArrayExtra(Intent.EXTRA_INITIAL_INTENTS);
    Intent[] initialIntents = null;
    if (pa != null) {
        initialIntents = new Intent[pa.length];
        for (int i = 0; i < pa.length; i++) {
            if (!(pa[i] instanceof Intent)) {
                VLog.w("ChooseActivity", "Initial intent #" + i
                        + " not an Intent: " + pa[i]);
                finish();
                return;
            }
            initialIntents[i] = (Intent) pa[i];
        }
    }
    super.onCreate(savedInstanceState, target, title, initialIntents, null, false, userId);
}
 
开发者ID:7763sea,项目名称:VirtualHook,代码行数:36,代码来源:ChooserActivity.java

示例4: onCreate

import android.content.Intent; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    Intent intent = getIntent();
    int userId = intent.getIntExtra(Constants.EXTRA_USER_HANDLE, VUserHandle.getCallingUserId());
    mOptions = intent.getParcelableExtra(EXTRA_DATA);
    mResultWho = intent.getStringExtra(EXTRA_WHO);
    mRequestCode = intent.getIntExtra(EXTRA_REQUEST_CODE, 0);
    Parcelable targetParcelable = intent.getParcelableExtra(Intent.EXTRA_INTENT);
    if (!(targetParcelable instanceof Intent)) {
        VLog.w("ChooseActivity", "Target is not an intent: " + targetParcelable);
        finish();
        return;
    }
    Intent target = (Intent) targetParcelable;
    CharSequence title = intent.getCharSequenceExtra(Intent.EXTRA_TITLE);
    if (title == null) {
        title = getString(R.string.choose);
    }
    Parcelable[] pa = intent.getParcelableArrayExtra(Intent.EXTRA_INITIAL_INTENTS);
    Intent[] initialIntents = null;
    if (pa != null) {
        initialIntents = new Intent[pa.length];
        for (int i = 0; i < pa.length; i++) {
            if (!(pa[i] instanceof Intent)) {
                VLog.w("ChooseActivity", "Initial intent #" + i
                        + " not an Intent: " + pa[i]);
                finish();
                return;
            }
            initialIntents[i] = (Intent) pa[i];
        }
    }
    super.onCreate(savedInstanceState, target, title, initialIntents, null, false, userId);
}
 
开发者ID:codehz,项目名称:container,代码行数:35,代码来源:ChooserActivity.java


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