本文整理了Java中android.content.Intent.replaceExtras()
方法的一些代码示例,展示了Intent.replaceExtras()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Intent.replaceExtras()
方法的具体详情如下:
包路径:android.content.Intent
类名称:Intent
方法名:replaceExtras
暂无
代码示例来源:origin: stackoverflow.com
Intent intent = getIntent();
intent.replaceExtras(new Bundle());
intent.setAction("");
intent.setData(null);
intent.setFlags(0);
代码示例来源:origin: stackoverflow.com
public class IntentReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
Intent intentForService = new Intent(context, MyIntentService.class);
intentForService.setAction(intent.getAction());
intentForService.setData(intent.getData());
intentForService.replaceExtras(intent.getExtras());
context.startService(intentForService);
}
}
代码示例来源:origin: MFlisar/GDPRDialog
public static <T extends GDPRActivity> void startActivityForResult(Activity activity, GDPRSetup setup, GDPRLocation location, Class<T> clazz, int requestCode) {
Intent intent = new Intent(activity, clazz);
intent.replaceExtras(GDPRViewManager.createBundle(setup, location));
activity.startActivityForResult(intent, requestCode);
}
代码示例来源:origin: dsolonenko/financisto
public void toIntent(Intent intent) {
Bundle bundle = intent.getExtras();
if (bundle == null) bundle = new Bundle();
toBundle(bundle);
intent.replaceExtras(bundle);
}
代码示例来源:origin: ManbangGroup/Phantom
@Override
public @Nullable Intent resolveActivity(Intent originIntent, int launchMode) {
ComponentName originComponent = originIntent.getComponent();
try {
String activity = LaunchModeManager.getInstance()
.resolveFixedActivity(originComponent.flattenToString(), launchMode);
Intent intent = new Intent(originIntent);
if (null != intent.getExtras()) {
//清空extras
intent.replaceExtras(new Bundle());
}
intent.setComponent(new ComponentName(PhantomServiceManager.getHostPackage(), activity));
intent.putExtra("origin_intent", originIntent);
return intent;
} catch (ProxyActivityLessException e) {
e.printStackTrace();
}
return null;
}
}
代码示例来源:origin: ManbangGroup/Phantom
if (null != newIntent.getExtras()) {
newIntent.replaceExtras(new Bundle());
代码示例来源:origin: ManbangGroup/Phantom
if (null != newIntent.getExtras()) {
newIntent.replaceExtras(new Bundle());
代码示例来源:origin: ManbangGroup/Phantom
intent.replaceExtras(newBundle);
originParcel.recycle();
intentParcel.recycle();
内容来源于网络,如有侵权,请联系作者删除!