本文整理匯總了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();
}
}
示例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();
}
}
}
示例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);
}
示例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);
}