Lvillani / android-cropimage中CropImage中的Nullpointer

时间:2013-09-02 08:18:44

标签: android android-camera crop android-image

我正在使用lvillani/android-cropimage库进行图像裁剪 -

if(new File(Environment.getExternalStorageDirectory()+"/camera2.png").exists())
        {
            final Uri dest = Uri.fromFile(new File(Environment.getExternalStorageDirectory()+"/camera2.png"));
            final CropImageIntentBuilder builder = new CropImageIntentBuilder(100, 100, dest).setDoFaceDetection(true);  
            startActivity(builder.getIntent(this));
        }

我得到了nullpointerexception -

09-02 13:42:53.881: E/AndroidRuntime(3152): FATAL EXCEPTION: main
09-02 13:42:53.881: E/AndroidRuntime(3152): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{me.villani.lorenzo.android.cropimage.example/com.android.camera.CropImage}: java.lang.NullPointerException
09-02 13:42:53.881: E/AndroidRuntime(3152):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1991)
09-02 13:42:53.881: E/AndroidRuntime(3152):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2092)
09-02 13:42:53.881: E/AndroidRuntime(3152):     at android.app.ActivityThread.access$600(ActivityThread.java:138)
09-02 13:42:53.881: E/AndroidRuntime(3152):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1203)
09-02 13:42:53.881: E/AndroidRuntime(3152):     at android.os.Handler.dispatchMessage(Handler.java:99)
09-02 13:42:53.881: E/AndroidRuntime(3152):     at android.os.Looper.loop(Looper.java:137)
09-02 13:42:53.881: E/AndroidRuntime(3152):     at android.app.ActivityThread.main(ActivityThread.java:4854)
09-02 13:42:53.881: E/AndroidRuntime(3152):     at java.lang.reflect.Method.invokeNative(Native Method)
09-02 13:42:53.881: E/AndroidRuntime(3152):     at java.lang.reflect.Method.invoke(Method.java:511)
09-02 13:42:53.881: E/AndroidRuntime(3152):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
09-02 13:42:53.881: E/AndroidRuntime(3152):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:556)
09-02 13:42:53.881: E/AndroidRuntime(3152):     at dalvik.system.NativeStart.main(Native Method)
09-02 13:42:53.881: E/AndroidRuntime(3152): Caused by: java.lang.NullPointerException
09-02 13:42:53.881: E/AndroidRuntime(3152):     at android.app.Activity.initActionBar(Activity.java:1847)
09-02 13:42:53.881: E/AndroidRuntime(3152):     at android.app.Activity.getActionBar(Activity.java:1834)
09-02 13:42:53.881: E/AndroidRuntime(3152):     at com.android.camera.DoneDiscardHelper.<init>(DoneDiscardHelper.java:55)
09-02 13:42:53.881: E/AndroidRuntime(3152):     at com.android.camera.CropImage.<init>(CropImage.java:98)
09-02 13:42:53.881: E/AndroidRuntime(3152):     at java.lang.Class.newInstanceImpl(Native Method)
09-02 13:42:53.881: E/AndroidRuntime(3152):     at java.lang.Class.newInstance(Class.java:1319)
09-02 13:42:53.881: E/AndroidRuntime(3152):     at android.app.Instrumentation.newActivity(Instrumentation.java:1053)
09-02 13:42:53.881: E/AndroidRuntime(3152):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1982)
09-02 13:42:53.881: E/AndroidRuntime(3152):     ... 11 more

0 个答案:

没有答案