Added "Start host activity" in Demo1

This commit is contained in:
zhangjiongxuan 2017-07-19 21:21:52 +08:00
parent 48d447f68c
commit 076fc5cf23

View File

@ -178,7 +178,15 @@ public class MainActivity extends Activity {
RePlugin.startActivity(v.getContext(), intent, "demo2", null);
}
}));
mItems.add(new TestItem("Activity: start Host activity(Main)", new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent();
intent.setComponent(new ComponentName(RePlugin.getHostContext().getPackageName(), "com.qihoo360.replugin.sample.host.MainActivity"));
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
MainActivity.this.startActivity(intent);
}
}));
// =========
// Other Components