Friday 15 February 2013

android - Keeping Activity when "Don't Keep Activities" is set -


I am doing an activity that calls the gallery so that the user can get permission to select an image And the user can wait to display this image.

If the user has used the "Do not take action" option in the development option, my app crashes when the user selects the image.

Is there no alternative to saving my activity from being destroyed? If not, how can I handle it so that the application does not crash

the code to start the gallery < / H1>
  intent = new intent (Intent.ACTION_PICK, android.provider.MediaStore .images.Media.EXTERNAL_CONTENT_URI); StartActivityForResult (i, RESULT_LOAD_IMAGE);   

error
  06-22 15: 23: 42.132: E / Android Random (4202): Fatal Exceptions: Key 06-22 15:23: 42.132: e / AndroidRuntime (4202): java.lang.RuntimeException: java.lang.IllegalStateException: no activity to start 06-22 15:23 ComponentInfo {com.exm.imageselect / com.exm.imageselect.HomeActivity} unable: 42.132: e / AndroidRuntime (4202): on android.app.ActivityThread.performLaunchActivity (ActivityThread.java:1970) 06-22 15: 23: 42.132: e / AndroidRuntime (4202): android.app.ActivityThread.handleLaunchActivity (ActivityThread .java: 1995) 06-22 15: 23: 42.132: E / Android Random (4202): Android. App ActiveTrade.X $ 600 (ActivityTrad.Quider 28) 06-22 15: 23: 42.132: E / AndroidMan (4202): android.app.ActivityThread $ H.handleMessage (ActivityThread.java:1161) 06-22 15: 23 : 42.132: E / AndroidRuntime (4202): android.os.Handler.dispatchMessage at (Handler.java:99) 06-22 15: 23: 42.132: E / Android Random (4202): Android. Los. Looper Loop (Looper.JavaProject 37) 06-22 15: 23: 42.132: E / Endurance Dirtime (4202): Android. App ActivateTrade.Mine (ActivityThaus.Java 4514) 06-22 15: 23: 42.132: E / Android Retentmann (4202): at java.lang.reflect.Method.invokeNative (Basic Method) 06-22 15: 23: 42.132: E / Android Rendime (4202): at java.lang.reflect.Method.invoke (Method Java 1111) 06-22 15: 23: 42.132: E / Android Time (4202): at com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run (ZygoteInit.java:790) 06-22 15: 23: 42.132: E / AndroidRuntime (4202): com.android.internal.os.ZygoteInit.main (ZygoteInit .java: 557) 06-22 15: 23: 42.132: e / Androiderntm (4202): DalvikksystemkNativeStartkmain (the original method) 06-22 15: 23: 42.132: e / Androidrentaim (4202) due by: JavaklangkIllegalStateException: no A. Activity 06-22 15: 23: 42.132: 06-22 E / AndroidRuntime (4202): android.support.v4.app.FragmentManagerImpl.moveToState (FragmentManager.java:1089) 15: 23: 42.132: E / Android Rentaim (4202): Android. Supportkv4kappkFragmentManagerImplkmoveToState (Fragmentmanjrkjawaoti 84) 06-22 15: 23: 42.132: E / Androidrentaim (4202)): the android.support.v4.app.FragmentManagerImpl.dispatchActivityCreated (FragmentManager.java:1875 ) 06-22 15: 23: 42.132: E / AndroidRuntime (4202): android.support.v4.app.FragmentActivity.onStart (FragmentActivity.javaety47) 06-22 15: 23: 42.132: E / Android Time (4202): Android App Instrumentation Call Aktivesnonstart (Instrumenteshnkjawa 1137) 06-22 15: 23: 42.132: E / Androidrentm (4202): Android.apkaktivtikprformstart (Gtividhikjawaः 1 9) 06-22 15: 23: 42.132: E / Androidrentaim (4202): Android. App ActivateTrade.Perform Launch Activity (ActivityTrad.Java 1943) 06 -22 15: 23: 42.132: E / Android Random (4202): ... 11 more    

(My copy in response to a similar question - I do not like, when the "see my answer in the second question" link) < P> I switched to intent. Action_GET_CONTENT with just the mime type and it looks like I have a HTC bug to work better.

  intent = intent (int. Action_jedicention); Intent.setType ("image / *");    

No comments:

Post a Comment