2

它工作正常,我不太确定我做了什么改变以使其停止工作。当我加载相机时它工作正常,它返回到失败的页面。我已经尝试删除照片返回腿上发生的事情,看看是否会导致它翻倒,但它真的不起作用。

这是我的错误:

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)

这是我的代码:

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

    }

任何帮助将不胜感激

汤姆

4

2 回答 2

1

例外是SuperNotCalledException

你只是错过了一个super.onStop()电话。

活动 {com.directenquiries.assessment.tool/com.directenquiries.assessment.tool.AddAsset} 没有调用 super.onStop()

于 2012-10-19T15:07:51.023 回答
1

在例外情况下:android.app.SuperNotCalledException: Activity {com.directenquiries.assessment.tool/com.directenquiries.assessment.tool.AddAsset} did not call through to super.onStop()

你有 onStop() 方法吗?在那里你必须调用 super.onStop()。

于 2012-10-19T15:09:15.713 回答