直接继承Activity就好了。
我这里找了源码看看怎么创建的
scheduleLaunchActivity
sendMessage(H.LAUNCH_ACTIVITY, r);
handleLaunchActivity(r, null, “LAUNCH_ACTIVITY”);
Activity a = performLaunchActivity(r, customIntent);
ContextImpl appContext = createBaseContextForActivity(r);
Activity activity = null;
try {
java.lang.ClassLoader cl = appContext.getClassLoader();
activity = mInstrumentation.newActivity(
cl, component.getClassName(), r.intent);
Application app = r.packageInfo.makeApplication(false, mInstrumentation);
activity.attach
final void performCreate(Bundle icicle) {
restoreHasCurrentPermissionRequest(icicle);
onCreate(icicle);
mActivityTransitionState.readState(icicle);
performCreateCommon();
}
Activity怎么创建
最新推荐文章于 2023-08-10 19:53:11 发布