[
https://issues.apache.org/jira/browse/CB-1147?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Joe Bowser resolved CB-1147.
----------------------------
Resolution: Not A Problem
OK, so there's not a JIRA setting for "Google released a bunch of extra
configChange bullshit and didn't tell anyone". To fix this add the following
to androidManifest:configChanges.
{code}
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale"
{/code}
The reason for this is that the orientation fires a screenSize change event,
which calls onPause, which then closes the app. The crashing is concerning,
because it means that the app isn't closing fast enough to unregister all the
receivers, but it wasn't supposed to close on orientation change in the first
place.
BTW: I had to go into the Android source and find the Browser's Android
Manifest to fix this. At least when it's open source and broken, you get to
keep both pieces.
> PhoneGap 2.0 "crashing" moving mobile to horizontal with "Hello World" sample
> -----------------------------------------------------------------------------
>
> Key: CB-1147
> URL: https://issues.apache.org/jira/browse/CB-1147
> Project: Apache Cordova
> Issue Type: Bug
> Components: Android
> Affects Versions: 2.0.0
> Environment: Android 4.0.3 in Samsung Galaxy S2
> Android 4.1.1 in Galaxy Nexus
> Android 4.0.3 in LG L5
> Reporter: Alex
> Assignee: Joe Bowser
> Priority: Critical
> Fix For: 2.1.0
>
>
> New project exactly as said in:
> http://docs.phonegap.com/en/2.0.0/guide_getting-started_android_index.md.html#Getting%20Started%20with%20Android
> index.html of "Hello world"
> I put the mobile in horizontal, and it "crashes".
> I put "Crashes" between quotes because, as I said, there's no "crash" alert
> message, it just go to Android Home page.
> The program is still in memory, if I put in foreground the program again, I
> just see the index.html with the "Hello world".
> Logcat shows this:
> 07-27 10:14:55.806: E/ActivityThread(16105): Activity com.myapp.MainActivity
> has leaked IntentReceiver org.apache.cordova.Device$1@4176d570 that was
> originally registered here. Are you missing a call to unregisterReceiver()?
> 07-27 10:14:55.806: E/ActivityThread(16105):
> android.app.IntentReceiverLeaked: Activity com.myapp.MainActivity has leaked
> IntentReceiver org.apache.cordova.Device$1@4176d570 that was originally
> registered here. Are you missing a call to unregisterReceiver()?
> 07-27 10:14:55.806: E/ActivityThread(16105): at
> android.app.LoadedApk$ReceiverDispatcher.<init>(LoadedApk.java:792)
> 07-27 10:14:55.806: E/ActivityThread(16105): at
> android.app.LoadedApk.getReceiverDispatcher(LoadedApk.java:593)
> 07-27 10:14:55.806: E/ActivityThread(16105): at
> android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1111)
> 07-27 10:14:55.806: E/ActivityThread(16105): at
> android.app.ContextImpl.registerReceiver(ContextImpl.java:1098)
> 07-27 10:14:55.806: E/ActivityThread(16105): at
> android.app.ContextImpl.registerReceiver(ContextImpl.java:1092)
> 07-27 10:14:55.806: E/ActivityThread(16105): at
> android.content.ContextWrapper.registerReceiver(ContextWrapper.java:365)
> 07-27 10:14:55.806: E/ActivityThread(16105): at
> org.apache.cordova.Device.initTelephonyReceiver(Device.java:156)
> 07-27 10:14:55.806: E/ActivityThread(16105): at
> org.apache.cordova.Device.setContext(Device.java:62)
> 07-27 10:14:55.806: E/ActivityThread(16105): at
> org.apache.cordova.api.PluginEntry.createPlugin(PluginEntry.java:81)
> 07-27 10:14:55.806: E/ActivityThread(16105): at
> org.apache.cordova.api.PluginManager.getPlugin(PluginManager.java:255)
> 07-27 10:14:55.806: E/ActivityThread(16105): at
> org.apache.cordova.api.PluginManager.exec(PluginManager.java:182)
> 07-27 10:14:55.806: E/ActivityThread(16105): at
> org.apache.cordova.CordovaChromeClient.onJsPrompt(CordovaChromeClient.java:207)
> 07-27 10:14:55.806: E/ActivityThread(16105): at
> android.webkit.CallbackProxy.handleMessage(CallbackProxy.java:655)
> 07-27 10:14:55.806: E/ActivityThread(16105): at
> android.os.Handler.dispatchMessage(Handler.java:99)
> 07-27 10:14:55.806: E/ActivityThread(16105): at
> android.os.Looper.loop(Looper.java:137)
> 07-27 10:14:55.806: E/ActivityThread(16105): at
> android.app.ActivityThread.main(ActivityThread.java:4745)
> 07-27 10:14:55.806: E/ActivityThread(16105): at
> java.lang.reflect.Method.invokeNative(Native Method)
> 07-27 10:14:55.806: E/ActivityThread(16105): at
> java.lang.reflect.Method.invoke(Method.java:511)
> 07-27 10:14:55.806: E/ActivityThread(16105): at
> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
> 07-27 10:14:55.806: E/ActivityThread(16105): at
> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
> 07-27 10:14:55.806: E/ActivityThread(16105): at
> dalvik.system.NativeStart.main(Native Method)
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira