Note that there are some explanatory texts on larger screens.

plurals
  1. POOne of my activities exits prematurely when SDK > 10, works properly if SDK <= 10
    primarykey
    data
    text
    <p>My program started to fail under SDK 4.0.4, but works on SDK 2.3.3, which doesn't make sense.</p> <p>The basic flow is:</p> <ul> <li>First Activity starts remote service and then calls second activity on a button click</li> <li>The second activity binds to the service, and then exits, with nothing in logcat to explain why it happened.</li> </ul> <p>This is what I see, after the service was started:</p> <pre><code>04-15 09:13:46.614: I/ErrandAssistantService(7015): Setting a new request for location updates 04-15 09:13:46.661: I/ErrandAssistantService(7015): saveProximityAlert - used GPS 04-15 09:13:46.669: I/ErrandAssistantService(7015): saveProximityAlert - used network 04-15 09:13:46.677: I/ErrandAssistantService(7015): saveProximityAlert - used GPS 04-15 09:13:46.681: I/ErrandAssistantService(7015): saveProximityAlert - used network </code></pre> <p>This happens in the second activity:</p> <pre><code>04-15 09:13:47.044: I/MapViewActivity(7039): OnResume: mapView loaded = true 04-15 09:13:47.083: I/MapActivity(7039): Handling network change notification:CONNECTED 04-15 09:13:47.196: I/ErrandMapActivity(7039): onServiceConnected 04-15 09:13:47.196: I/ErrandMapActivity(7039): registering callback 04-15 09:13:47.200: I/ErrandAssistantService(7015): registerCallback 04-15 09:13:47.200: I/ErrandMapActivity(7039): onResume - binding succeeded </code></pre> <p>Then I see this, which comes from the service, trying to send information to the second activity (which has already exited):</p> <pre><code>04-15 09:13:49.142: I/ErrandAssistantService(7015): Sent location changed callback 04-15 09:13:49.142: I/ErrandAssistantService(7015): Sent route changed 04-15 09:13:49.142: I/ErrandAssistantService(7015): geoPoint set </code></pre> <p>So, the activity had bound to the service, and then later the service sends back data to the activity, but that activity has already exited.</p> <p>If I set this to be higher than 10 then it crashes, otherwise it works fine:</p> <pre><code>&lt;uses-sdk android:minSdkVersion="7" android:targetSdkVersion="10" /&gt; </code></pre> <p>So, how do I troubleshoot that having a higher SDK version crashes the application with no exception, and it doesn't go through <code>onStop</code> or <code>onDestroy</code>?</p> <p>In the second activity I have this, which wasn't called, so however it exits appears to be abnormal.</p> <pre><code>@Override public void onStop() { Log.i(TAG, "onStop"); super.onStop(); } </code></pre> <p>If I have the SDK version set to 17, but the phone is SDK 2.3.3 then it doesn't crash, but that would appear to be the same as when I set the version of the SDK to be 10 and the phone is version 4.0.4.</p> <p>I also tried the second activity where it doesn't bind to the service, but the same behavior was observed, so it appears not to be related to the remote service.</p> <p>I also had the service run in the same process as the activity, to see if I could get any debugging information, but that also didn't give me any additional information.</p> <p>I don't like having to set the SDK version to be so low, but I needed to get a new update out, and this was the only solution that appears to work.</p>
    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.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    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