Note that there are some explanatory texts on larger screens.

plurals
  1. POApplication crashes on rotation without stackTrace
    primarykey
    data
    text
    <p>I'm having a very strange problem with my app, which consists of an Activity and 2 Fragments (android.support.v4.app.Fragment).</p> <p>The problem is when I rotate my tablet : the app crashes right away.</p> <p>A few days before, everything was working fine, but I had to change packages name, that threw a few errors but I manage to correct them. Problem appeared right after that, but I just can't find where is the error. Here is the Logcat I get right after the app is destroyed, restarted, resumed and created :</p> <pre><code>10-08 17:00:14.930: D/dalvikvm(18155): GC_CONCURRENT freed 394K, 8% free 7792K/8455K, paused 1ms+4ms 10-08 17:00:14.930: D/AndroidRuntime(18155): Shutting down VM 10-08 17:00:14.930: W/dalvikvm(18155): threadid=1: thread exiting with uncaught exception (group=0x40bee1f8) 10-08 17:00:14.938: E/AndroidRuntime(18155): FATAL EXCEPTION: main 10-08 17:00:14.938: E/AndroidRuntime(18155): java.lang.IllegalStateException: No activity 10-08 17:00:14.938: E/AndroidRuntime(18155): at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1070) 10-08 17:00:14.938: E/AndroidRuntime(18155): at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1065) 10-08 17:00:14.938: E/AndroidRuntime(18155): at android.support.v4.app.FragmentManagerImpl.dispatchResume(FragmentManager.java:1854) 10-08 17:00:14.938: E/AndroidRuntime(18155): at android.support.v4.app.FragmentActivity.onResumeFragments(FragmentActivity.java:431) 10-08 17:00:14.938: E/AndroidRuntime(18155): at android.support.v4.app.FragmentActivity$1.handleMessage(FragmentActivity.java:90) 10-08 17:00:14.938: E/AndroidRuntime(18155): at android.os.Handler.dispatchMessage(Handler.java:99) 10-08 17:00:14.938: E/AndroidRuntime(18155): at android.os.Looper.loop(Looper.java:137) 10-08 17:00:14.938: E/AndroidRuntime(18155): at android.app.ActivityThread.main(ActivityThread.java:4514) 10-08 17:00:14.938: E/AndroidRuntime(18155): at java.lang.reflect.Method.invokeNative(Native Method) 10-08 17:00:14.938: E/AndroidRuntime(18155): at java.lang.reflect.Method.invoke(Method.java:511) 10-08 17:00:14.938: E/AndroidRuntime(18155): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790) 10-08 17:00:14.938: E/AndroidRuntime(18155): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557) 10-08 17:00:14.938: E/AndroidRuntime(18155): at dalvik.system.NativeStart.main(Native Method) </code></pre> <p>The problem comes from FragmentManager but why, I don't know, as I don't have any details. I tried a solution i found on this site to get more info, by catching uncaught exception, but the result i got was the same Logcat repeated again and again until some kind of out of memory error happened(too many strings in the logcat).</p> <p>My Activity's layout is the following one, it works well with android lifecycle, but not with screen rotation :</p> <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal" android:id = "@+id/mainview" tools:context=".MyActivity" &gt; &lt;fragment android:id="@+id/missionFragment" android:layout_width="350dip" android:layout_height="match_parent" android:layout_marginTop="?android:attr/actionBarSize" android:name="com.xxx.xxx.MissionFragment"&gt; &lt;/fragment&gt; &lt;fragment android:id="@+id/mapFragment" android:layout_width="match_parent" android:layout_height="match_parent" android:name="com.xxx.xxx.MapFragment"&gt; &lt;/fragment&gt; &lt;/LinearLayout&gt; </code></pre> <p>Manifest is right there :</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.xxx.xxx" android:versionCode="1" android:versionName="1.0" &gt; &lt;uses-sdk android:minSdkVersion="11" /&gt; &lt;uses-permission android:name="android.permission.INTERNET" /&gt; &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /&gt; &lt;uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" /&gt; &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt; &lt;uses-permission android:name="android.permission.RECORD_AUDIO" /&gt; &lt;uses-permission android:name="android.permission.READ_CONTACTS" /&gt; &lt;uses-feature android:glEsVersion="0x00020000" android:required="true" /&gt; &lt;application android:icon="@drawable/logo" android:label="@string/app_name" &gt; &lt;activity android:name=".MySIGActivity" android:label="@string/app_name" android:windowSoftInputMode="stateHidden" &gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;/application&gt; &lt;/manifest&gt; </code></pre> <p>If anyone has any idea on where would the error come, on which android lifecycle method, that would be welcomed!</p> <p>Thanks. </p> <p><strong>UPDATE 1.1:</strong> Here is onCreate method of my main Activity :</p> <pre><code>@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); context = getApplicationContext(); currentEtape = 1; // Set up the action bar. final ActionBar actionBar = getActionBar(); actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD); // Désactiver l'affichage du titre de l'application et son icône actionBar.setDisplayShowHomeEnabled(true); actionBar.setDisplayShowTitleEnabled(true); setContentView(R.layout.main); SharedPreferences prefs = getPreferences(0); trackingGPS = prefs.getBoolean("trackingGPS", false); if(trackingGPS){ TextView viewTrackingActive = (TextView)findViewById(R.id.textview_notif_tracking); viewTrackingActive.setText(this.getString(R.string.active)); viewTrackingActive.setTextColor(Color.parseColor("#99CC00")); } else{ TextView viewTrackingDesactive = (TextView)findViewById(R.id.textview_notif_tracking); viewTrackingDesactive.setText(this.getString(R.string.desactive)); viewTrackingDesactive.setTextColor(Color.parseColor("#CC0000")); } // No interaction with Fragment or Activity classes in these methods instanciateLayersDialog(); instanciateBasemapDialog(); } </code></pre> <p>And onResume method : </p> <pre><code>public void onResume(){ super.onResume(); SharedPreferences prefs = getPreferences(0); trackingGPS = prefs.getBoolean("trackingGPS", false); System.out.println("activity resume"); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload