MissCoder87
MissCoder87

Reputation: 2669

Android: Launching camera app now crashes app

It was working fine, and i'm not too sure what i've changed to make it stop working. When I load the camera it works fine, it's on the return to the page that it fails. I've tried removing what happens on the return leg of the photo to see if that's making it fall over, but it's really not working.

Here is my error:

10-19 16:01:43.455: W/IInputConnectionWrapper(5309): getSelectedText on inactive InputConnection
10-19 16:01:43.455: E/Asset Sub Group(5309): 1
10-19 16:01:43.480: W/IInputConnectionWrapper(5309): setComposingText on inactive InputConnection
10-19 16:01:43.480: W/IInputConnectionWrapper(5309): finishComposingText on inactive InputConnection
10-19 16:01:47.045: W/IInputConnectionWrapper(5309): getSelectedText on inactive InputConnection
10-19 16:01:47.055: W/IInputConnectionWrapper(5309): getTextBeforeCursor on inactive InputConnection
10-19 16:01:47.055: W/IInputConnectionWrapper(5309): getTextAfterCursor on inactive InputConnection
10-19 16:01:47.300: W/IInputConnectionWrapper(5309): showStatusIcon on inactive InputConnection
10-19 16:01:52.315: W/dalvikvm(5309): threadid=1: thread exiting with uncaught exception (group=0x40c721f8)
10-19 16:01:52.320: E/AndroidRuntime(5309): FATAL EXCEPTION: main
10-19 16:01:52.320: E/AndroidRuntime(5309): android.app.SuperNotCalledException: Activity {com.directenquiries.assessment.tool/com.directenquiries.assessment.tool.AddAsset} did not call through to super.onStop()
10-19 16:01:52.320: E/AndroidRuntime(5309):     at android.app.Activity.performStop(Activity.java:4673)
10-19 16:01:52.320: E/AndroidRuntime(5309):     at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3088)
10-19 16:01:52.320: E/AndroidRuntime(5309):     at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3147)
10-19 16:01:52.320: E/AndroidRuntime(5309):     at android.app.ActivityThread.access$1200(ActivityThread.java:128)
10-19 16:01:52.320: E/AndroidRuntime(5309):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1194)
10-19 16:01:52.320: E/AndroidRuntime(5309):     at android.os.Handler.dispatchMessage(Handler.java:99)
10-19 16:01:52.320: E/AndroidRuntime(5309):     at android.os.Looper.loop(Looper.java:137)
10-19 16:01:52.320: E/AndroidRuntime(5309):     at android.app.ActivityThread.main(ActivityThread.java:4517)
10-19 16:01:52.320: E/AndroidRuntime(5309):     at java.lang.reflect.Method.invokeNative(Native Method)
10-19 16:01:52.320: E/AndroidRuntime(5309):     at java.lang.reflect.Method.invoke(Method.java:511)
10-19 16:01:52.320: E/AndroidRuntime(5309):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:993)
10-19 16:01:52.320: E/AndroidRuntime(5309):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:760)
10-19 16:01:52.320: E/AndroidRuntime(5309):     at dalvik.system.NativeStart.main(Native Method)

Heres my code:

public void startCamera() 
    {
        File photo = null;
        Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");
        timestamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());

        if (android.os.Environment.getExternalStorageState().equals(android.os.Environment.MEDIA_MOUNTED)) 
               {
                   photo = new File(Global.Pictures + timestamp +".png");

               } 
        else 
               {
                   photo = new File(getCacheDir(), FOLDER_NAME+File.separator+timestamp+".png");
               }    
        if (photo != null) 
               {
                   intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(photo));
                   selectedImageUri = Uri.fromFile(photo);
                   startActivityForResult(intent, CAPTURE_IMAGE_CALLBACK);
               }

    }

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    // TODO Auto-generated method stub
    super.onActivityResult(requestCode, resultCode, data);
    if (requestCode == 1){

    if(resultCode == RESULT_OK) {

      String PhotoDescription = DBFunctions.GetObjectName(StationObjectID);
      String PhotoDate = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date()); 

 }

    if(resultCode == RESULT_CANCELED) {

       Context context = getApplicationContext();
        CharSequence text = "Photo Capture Cancelled";
        int duration = Toast.LENGTH_SHORT;

        Toast toast = Toast.makeText(context, text, duration);
        toast.show();

    }

Any help will be appreciated

Tom

Upvotes: 2

Views: 930

Answers (2)

PKeidel
PKeidel

Reputation: 2589

In the exception stands: android.app.SuperNotCalledException: Activity {com.directenquiries.assessment.tool/com.directenquiries.assessment.tool.AddAsset} did not call through to super.onStop()

Have you got an onStop() method? There you have to call super.onStop().

Upvotes: 1

shkschneider
shkschneider

Reputation: 18243

The exception is SuperNotCalledException.

You just miss a super.onStop() call.

Activity {com.directenquiries.assessment.tool/com.directenquiries.assessment.tool.AddAsset} did not call through to super.onStop()

Upvotes: 1

Related Questions