因为最近在做一个私活,所以好久不更博客了
这篇博客就算是记录我项目中的一个新技能吧
手机连接Android Studio然后打开到你想要看的Activity(任何一个应用都可以)
执行下面这条命令
adb shell dumpsys activity activities
我们这里能看到cmp=com.lexuepai/.HomeActivity}
包名 com.lexuepai
类名 com.lexuepai.HomeActivity
知道该页面的话,我们就可以直接通过Intent打开这个页面
Intent intent = new Intent();
ComponentName cn = new ComponentName("com.lexuepai", "com.lexuepai.HomeActivity");
intent.setComponent(cn);
startActivity(intent);