Blank screen on android

You must Login before you can answer or comment on any questions.

Hi!

Anyone found a solution to the blank screen, when resuming an app on android, after having the screen turned off for a while? We really don't want to have to rewrite our app in java for this extremely annoying bug. Impossible to try to fix with alternative methods, when it takes at least 15 minutes for the bug to appear. app.js adds a tabgroup and has all the code for the first tab window in it. (Everything works great for iPhone)

David's code in: http://developer.appcelerator.com/question/102921/blank-screen-on-resume doesn't work for us either. The resume event is only fired when starting the app, never when returning after hitting the home button. Is there any way to make the app exit when pressing home?

10 Answers

My code in the above link was a hack. See this jira issue for the explanation and this one for how to the fix it.

In a nutshell you need to add android:alwaysRetainTaskState="true" to your root activity.

I am suffering the same problem and clearly this is preventing me from releasing any application on Android. Quite annoying!

Any solution or workaround is more than welcomed.

Having the same issue, and android:alwaysRetainTaskState="true" does nothing :(

I've been having this problem too, it's taken me weeks to pinpoint it down to this. Hoping that the solution herein works, will post back to check.

In the meantime, I've tried other things, and all I've found is that the app doesn't actually break until you try to restart it. Wondering if it's related to 'Layout Cleanup' from TiBaseActivity in the DDMS log.

same problem here, using sdk 1.8.0, android 4.0/4.03

any solution yet?

Look in kitchen sink manifest XML file, match it and you'll be good to go.

— answered 2 years ago by David Horton
answer permalink
8 Comments
  • I've been using this for some days now, but it doesn't solve the problem. Running 3 apps that I am building on, all 3 have the problem.

    <android xmlns:android="http://schemas.android.com/apk/res/android">
            <tool-api-level>8</tool-api-level>
            <manifest android:installLocation="auto" android:versionCode="2" android:versionName="1.1">
                <uses-sdk android:minSdkVersion="7" />
                <supports-screens android:anyDensity="true"
                    android:largeScreens="true" android:normalScreens="true" android:smallScreens="true"/>
                <application>
                    <activity android:alwaysRetainTaskState="true"
                        android:configChanges="keyboardHidden|orientation"
                        android:label="Applabel"
                        android:name=".ApplabelActivity" android:theme="@style/Theme.Titanium">
                        <intent-filter>
                            <action android:name="android.intent.action.MAIN"/>
                            <category android:name="android.intent.category.LAUNCHER"/>
                        </intent-filter>
                    </activity>
                </application>
            </manifest>
        </android>

    — commented 2 years ago by Arjan Brinkman

  • important notice:

    when I wait for the app to come up with an error I get the following message:

    Activity "name of app" is not responding. After that I can close or wait.

    Android report:

    ANR keyDispatchingTimedOut in TiTabActivity
    Freeze
    Activitty fail.android.app/ti.modules.titanium.ui.TiTabActivity
    Cause ANR keyDispatchingTimedOut
    Link to stacktrace output: http://pastebin.com/mBPCNuTC

    — commented 2 years ago by Arjan Brinkman

  • Didn't work for me either. REALLY frustrating to have to hold off launching our apps because of this. This is the type of issue I was afraid of when choosing to go with a non-native development platform.

    — commented 2 years ago by Jake Horner

  • Show 5 more comments

any news? Status on bugreport says it's resolved: https://jira.appcelerator.org/browse/TIMOB-7293

OK. So it looks like the bug returned with vengeance in 1.8.x, but is now fix again with the above changes to the manifest/tiapp.xml.

Go to the following link and download the latest build from the master branch (in the drop-down at the top).

— answered 2 years ago by David Bankier
answer permalink
2 Comments
  • Using build mobilesdk-2.0.0.v20120222101634 with the above additions to TiApp.xml I am still having the same problem. The app just stays at the splash screen

    — commented 2 years ago by Frodeaux *

  • I am experiencing the same splash screen problem. Chris: did you find a way to solve it?

    — commented 2 years ago by Nahum Romero

After adding <property name="ti.android.root.reappears.restart" type="bool">true</property> to tiapp.xml the app seems to restart normally

I'm on 3.1.3 GA (XPeria Arc S) and this issue still persist. I've tried all the solutions above but nothing helped. LogCat is reporting that custom modules are re-created ok, however the screen is blank (black). One message I noticed in the LogCat was:

W/PhoneWindow(7206): Previously focused view reported id 235 during save, but can't be found during restore.
This would indicate something wrong when restoring the window from a persistent state. Might be that if there's a complex window with many subviews, the Appcelerator platform has difficulties reconstructing it properly (or does it in wrong order).

Well, 3 years and still no reasonable fix. Yet another reason to go native.

— answered 6 months ago by Ondrej Urik
answer permalink
3 Comments
  • We have the same problem for our Android app. None of the solutions above helped me to solve it.

    ... BUT ...

    We recently observed that the KitchenSink app (from Appcelerator) is not affected (using the exact same Titanium SDK, Android SDK, ...). Looking deeper in our code, we eventually found that one of our included module was the origin of the issue. If we remove this module from the tiapp.xml, the issue disappears.

    You should check your modules if you have ones! Remove all of them and try to reproduce

    The UrbanAirship module generate the issue on our app.

    It is really hard for me, right now, to understand why. I will check the diff in the AndroidManifest with and without the module.

    On app resume (+ white screen of death...), in the Android Monitor, there is some logs like "ignoring postAnalyticsEvent" that make me curious:

    11-21 09:25:04.369: D/TiBaseActivity(13388): (main) [26180,29805] Activity org.appcelerator.titanium.TiActivity@42daefa8 onPause
    11-21 09:25:04.389: I/TiApplication(13388): (main) [19,29824] Analytics are disabled, ignoring postAnalyticsEvent
    11-21 09:25:38.402: I/Dev 0.0.0 - UALib(13388): Sending 1 events.
    11-21 09:25:38.422: I/Dev 0.0.0 - UALib(13388): Sending Analytics to: https://combine.urbanairship.com/warp9/
    11-21 09:25:38.972: I/Dev 0.0.0 - UALib(13388): Warp 9 response: 200

    — commented 5 months ago by Arnaud Besnier

  • Our issue with the UrbanAirship module is not solved. So any help is really welcome!

    — commented 5 months ago by Arnaud Besnier

  • Hi Arnaud,

    Can you share tiapp.xml ? To have a look at the Android manifest section specifically. I'd be happy to to provide recommendations. Does the problem occur at any Android OS on particular? Any TiSDK you can state?

    Thanks.

    — commented 5 months ago by Eduardo Gomez

Your Answer

Think you can help? Login to answer this question!