本文整理汇总了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);
}