是否可以在PhoneGap中使用此功能:
navigator.camera.getPicture(onPhotoLoadSuccess, onFail, { quality: 50,
destinationType: navigator.camera.DestinationType.FILE_URI,
sourceType: navigator.camera.PictureSourceType.PHOTOLIBRARY });
onFail总是被调用,因为它无法访问摄像头。我知道模拟器没有相机,但我想仍然可以访问照片库。
我已经将SD卡设置为20GB。
任何人都可以使用它吗?
编辑:
我收到以下错误:
10-20 16:46:53.418: ERROR/AndroidRuntime(632): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.gallery/com.android.camera.ImageGallery}: android.util.AndroidRuntimeException: You cannot combine custom titles with other title features
10-20 16:46:53.418: ERROR/AndroidRuntime(632): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1815)
10-20 16:46:53.418: ERROR/AndroidRuntime(632): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1831)
10-20 16:46:53.418: ERROR/AndroidRuntime(632): at android.app.ActivityThread.access$500(ActivityThread.java:122)
10-20 16:46:53.418: ERROR/AndroidRuntime(632): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1024)
10-20 16:46:53.418: ERROR/AndroidRuntime(632): at android.os.Handler.dispatchMessage(Handler.java:99)
10-20 16:46:53.418: ERROR/AndroidRuntime(632): at android.os.Looper.loop(Looper.java:132)
10-20 16:46:53.418: ERROR/AndroidRuntime(632): at android.app.ActivityThread.main(ActivityThread.java:4123)
10-20 16:46:53.418: ERROR/AndroidRuntime(632): at java.lang.reflect.Method.invokeNative(Native Method)
10-20 16:46:53.418: ERROR/AndroidRuntime(632): at java.lang.reflect.Method.invoke(Method.java:491)
10-20 16:46:53.418: ERROR/AndroidRuntime(632): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
10-20 16:46:53.418: ERROR/AndroidRuntime(632): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
10-20 16:46:53.418: ERROR/AndroidRuntime(632): at dalvik.system.NativeStart.main(Native Method)
10-20 16:46:53.418: ERROR/AndroidRuntime(632): Caused by: android.util.AndroidRuntimeException: You cannot combine custom titles with other title features
10-20 16:46:53.418: ERROR/AndroidRuntime(632): at com.android.internal.policy.impl.PhoneWindow.requestFeature(PhoneWindow.java:204)
10-20 16:46:53.418: ERROR/AndroidRuntime(632): at com.android.internal.policy.impl.PhoneWindow.generateLayout(PhoneWindow.java:2338)
10-20 16:46:53.418: ERROR/AndroidRuntime(632): at com.android.internal.policy.impl.PhoneWindow.installDecor(PhoneWindow.java:2545)
10-20 16:46:53.418: ERROR/AndroidRuntime(632): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:219)
10-20 16:46:53.418: ERROR/AndroidRuntime(632): at android.app.Activity.setContentView(Activity.java:1786)
10-20 16:46:53.418: ERROR/AndroidRuntime(632): at com.android.camera.ImageGallery.onCreate(ImageGallery.java:113)
10-20 16:46:53.418: ERROR/AndroidRuntime(632): at android.app.Activity.performCreate(Activity.java:4397)
10-20 16:46:53.418: ERROR/AndroidRuntime(632): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1048)
10-20 16:46:53.418: ERROR/AndroidRuntime(632): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1779)
另外作为一个注释,这可行:
navigator.camera.getPicture(onPhotoLoadSuccess, onFail, { quality: 50,
destinationType: navigator.camera.DestinationType.FILE_URI });
但是当设置了sourceType时却没有......