當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。