2

我正在构建一个主屏幕替换应用程序,并且想知道如何在正常模式下启动相机应用程序。“Home”示例没有列出相机应用程序,因为它没有作为单独的应用程序安装在设备上(这解释了为什么我的 Galaxy nexus 相机问题没有得到解决)。换句话说,我想以与从我的股票主屏幕启动器相同的方式启动相机应用程序......

4

1 回答 1

1

you would probably want to open an intent from a Component name with the Main intent instead of the usual method of calling the camera for an answer.

You can open any activity on Android as if you are clicking on it in the home screen you just need the compentent name, you can get the component name by opening it normally as a user then reading it off your logcat when the activity opens... I have done the Camera intent for you.

       Intent intent = new Intent("android.intent.action.MAIN");
   intent.setComponent(ComponentName.unflattenFromString("com.google.android.camera/com.android.camera.Camera"));
   intent.addCategory("android.intent.category.LAUNCHER");
   startActivity(intent);   
于 2012-04-03T21:25:41.383 回答