15

我在 Android 4.2 Jelly Bean 中遇到问题。

如何从我的应用程序中打开相机,默认为全景/360 全景照片模式?

我在grepcodeCamera.Parameters中进行了很多搜索,但似乎没有任何帮助。除了视频和图像之外,是否有人有任何线索可以在全景模式下打开相机?

4

3 回答 3

3

没有标准的方法来做到这一点。AFAIK Panorama、Photoshere 是 Gallery3d(由 Google 提供)包 com.google.android.gallery3d 的专有功能。这取决于设备的固件。

在 ApplicationManifest.xml 中

<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);

但它会在相机应用程序中引发 NullPointerException。

于 2013-03-17T20:09:56.450 回答
2

我也希望在我的应用程序中打开 photosphere 相机,或者至少在普通相机中显示 photosphere 选项。我搜索了很多,但我没有找到任何解决方案。

我认为我们没有任何解决方案来打开 photosphere 相机。我们需要等待下一个 Android API 版本。

如何打开光球相机?

于 2013-04-25T10:46:29.550 回答
2

您可以使用以下代码打开所有默认相机功能

 Intent intent = new Intent(MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA);
    startActivity(intent);
于 2017-08-17T13:10:24.187 回答