我主要对全景选项感兴趣。有没有办法打开原生相机应用程序(增强版),这样用户可以在普通照片和全景视图之间切换?有可能或者我应该停止尝试吗?
这是我现在使用的代码:
Intent i = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(i, CAMERA_REQUEST);
这是目前发生的事情:
这就是我需要实现的目标:
谢谢!
显然,由于它们依赖于Google提供的专有类,因此无法直接从应用程序使用全景或光球模式。也许在下一个Android API版本中它是可能的。
见How to open camera directly in panorama/photosphere mode?或How to open photosphere camera?
没有标准的方法可以做到这一点。 AFAIK Panorama,Photoshere是Gallery3d(由Google提供)软件包com.google.android.gallery3d的专有功能。这取决于设备的固件。
在清单文件中
<activity clearTaskOnLaunch="true" screenOrientation="0"
name="com.google.android.apps.lightcycle.ProtectedPanoramaCaptureActivity"
theme="resource_id:0x1030007"
configChanges="1184"
label="resource_id:0x7f0a00b2"
windowSoftInputMode="35"
taskAffinity="com.google.android.camera">
<intent-filter>
<action name="android.intent.action.MAIN">
</action>
</intent-filter>
</activity>
在你的活动中
Intent res = new Intent();
String mPackage = "com.google.android.gallery3d";
String mClass = "com.google.android.apps.lightcycle.ProtectedPanoramaCaptureActivity";
res.setComponent(new ComponentName(mPackage,mClass));
startActivity(res);
您可以使用以下代码打开全景模式
Intent intent = new Intent(MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA);
startActivity(intent);