Blank screen on android


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:
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 4 years ago by David Horton
    • 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="">
              <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"/>
                      <activity android:alwaysRetainTaskState="true"
                          android:name=".ApplabelActivity" android:theme="@style/Theme.Titanium">
                              <action android:name="android.intent.action.MAIN"/>
                              <category android:name="android.intent.category.LAUNCHER"/>

      — commented 4 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
      Cause ANR keyDispatchingTimedOut

      Link to stacktrace output:

      — commented 4 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 4 years ago by Jake Horner
    • Is there a workarround?

      — commented 4 years ago by Sander Beck
    • Mine works fine with the manifest above. The problem lies elsewhere, like in the way your window is set up. I'd take a different approach, and look carefully in the device logcat for other problems. Try the easy stuff, clearing out build folder etc.

      — commented 4 years ago by David Horton
    • The problem does not lie elsewhere. The default Hello World app displays this issue with and without the manifest entries added. It is a systemic problem and not one caused by any coding approach. The manifest entries do nothing to help this issue. Verified on Droid, DroidX and Xoom.

      — commented 4 years ago by Tom Hill
    • I'm at a loss for you guys then. Maybe it's a Ti SDK version issue, I'm on 1.7.5? My app hit the market with no issues after I used the manifest thing. Maybe try a fresh project in the SDK version you want to use…

      — commented 4 years ago by David Horton
    • We're on SDK 1.8.1 and we're still having the blank-screen problem after making the Android Manifest mods. As I think everyone will agree, this seems like a pretty bad regression.

      — commented 4 years ago by Joe Falcone
  • any news? Status on bugreport says it's resolved:

  • 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 4 years ago by David Bankier
    • 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 4 years ago by Frodeaux *
    • I am experiencing the same splash screen problem. Chris: did you find a way to solve it?

      — commented 4 years ago by Nahum Romero
  • After adding <property name="" 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 2 years ago by Ondrej Urik
    • 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:
      11-21 09:25:38.972: I/Dev 0.0.0 - UALib(13388): Warp 9 response: 200

      — commented 2 years ago by Arnaud Besnier
    • Our issue with the UrbanAirship module is not solved.
      So any help is really welcome!

      — commented 2 years 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?


      — commented 2 years ago by Eduardo Gomez