Android教程網
  1. 首頁
  2. Android 技術
  3. Android 手機
  4. Android 系統教程
  5. Android 游戲
 Android教程網 >> Android系統教程 >> Android開發教程 >> Android:魅族Flyme OS 3攝像頭無法預覽的問題

Android:魅族Flyme OS 3攝像頭無法預覽的問題

編輯:Android開發教程

錯誤代碼:

12-12 14:28:34.692: E/AndroidRuntime(1524): java.lang.RuntimeException: startPreview failed
12-12 14:28:34.692: E/AndroidRuntime(1524):     at android.hardware.Camera.startPreview(Native Method)
12-12 14:28:34.692: E/AndroidRuntime(1524):     at com.nmbb.example.sampleexecutejs.CameraDemoActivity.surfaceCreated(CameraDemoActivity.java:85)
12-12 14:28:34.692: E/AndroidRuntime(1524):     at android.view.SurfaceView.updateWindow(SurfaceView.java:569)
12-12 14:28:34.692: E/AndroidRuntime(1524):     at android.view.SurfaceView.access$000(SurfaceView.java:86)
12-12 14:28:34.692: E/AndroidRuntime(1524):     at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:174)
12-12 14:28:34.692: E/AndroidRuntime(1524):     at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:680)
12-12 14:28:34.692: E/AndroidRuntime(1524):     at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1896)
12-12 14:28:34.692: E/AndroidRuntime(1524):     at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:999)
12-12 14:28:34.692: E/AndroidRuntime(1524):     at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4470)
12-12 14:28:34.692: E/AndroidRuntime(1524):     at android.view.Choreographer$CallbackRecord.run(Choreographer.java:749)
12-12 14:28:34.692: E/AndroidRuntime(1524):     at android.view.Choreographer.doCallbacks(Choreographer.java:562)
12-12 14:28:34.692: E/AndroidRuntime(1524):     at android.view.Choreographer.doFrame(Choreographer.java:532)
12-12 14:28:34.692: E/AndroidRuntime(1524):     at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:735)
12-12 14:28:34.692: E/AndroidRuntime(1524):     at android.os.Handler.handleCallback(Handler.java:725)
12-12 14:28:34.692: E/AndroidRuntime(1524):     at android.os.Handler.dispatchMessage(Handler.java:92)
12-12 14:28:34.692: E/AndroidRuntime(1524):     at android.os.Looper.loop(Looper.java:137)
12-12 14:28:34.692: E/AndroidRuntime(1524):     at android.app.ActivityThread.main(ActivityThread.java:5068)
12-12 14:28:34.692: E/AndroidRuntime(1524):     at java.lang.reflect.Method.invokeNative(Native Method)
12-12 14:28:34.692: E/AndroidRuntime(1524):     at java.lang.reflect.Method.invoke(Method.java:511)
12-12 14:28:34.692: E/AndroidRuntime(1524):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
12-12 14:28:34.692: E/AndroidRuntime(1524):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
12-12 14:28:34.692: E/AndroidRuntime(1524):     at dalvik.system.NativeStart.main(Native Method)

 

錯誤原因:

只要給Activity設置了android:process屬性,就沒法預覽!!!出現在魅族Flyme OS 3中,Flyme OS 1和Flyme OS 2沒有問題。

解決方法:

暫時沒啥好辦法,只能不用android:process

作者:cnblogs 農民伯伯

  1. 上一頁:
  2. 下一頁:
熱門文章
閱讀排行版
Copyright © Android教程網 All Rights Reserved