I have an app that works perfectly fine after tons of testing, but when I exit out of the app (hit home screen) and let it sit for a while and come back to the app, I just have a black screen. I have tried to reproduce this, but have been unable to, because it is only when I let the phone sit for a while...I have tried exiting out on each activity and even opening memory intensive apps on top of my app, then going back to my app, but it always works fine. Unless I wait a while with the screen turned off then come back...black screen. Any ideas? Im not overriding onresume or onstart, should I be?
I've never seen this issue before but here are some tips you could try:
Check your LogCat to see the results of what's happening after letting your phone sit for a while
Are you able to reproduce this on the emulator?
Just curious, what type of phone are you testing this on? What Android version are you using?
Related
My Android emulator crashes whenever I press keys on the pc keyboard or hit the emulator side buttons. the only part that works is the emulator mobile screen. This doesn't happen to just one device but to all emulators I use. This is really annoying cause whenever I press any key on the keyboard while the emulator screen is active it will instantly crash. But keystrokes won't crush it when text input is active on the emulator screen. The operating system I use is ubuntu but Windows fix is also useful.
I need help from someone who has managed to solve this problem before.
I'm pretty sure I got this error before too. Whenever I pressed a button, the emulator would just say "Saving State..." and just closes. The only solution I found to fix this was to delete the emulator and create a new one. It's not the most effective solution, but I couldn't find any other solutions.
i have a Phonegap and JQM app.
Problem is, if I switch to another app and then back to my app, App is completely reloaded and start again.
Is posible this disable?
Thanks for any advice.
This is happening because there is a lack of memory for the app to run. So as soon as u go to home the app dies and on opening again it reloads the app from the start. To confirm that this is indeed happening i would suggest that you close all running apps on your phone and then run your app. Im sure it would run properly even after switching to home screen and coming back.I don't think its possible to get around this behavior. Design your app so that it has a small startup time so that its usable even on phones with less ram where such problems would come.
In my app when i press home button and open the app from menu or shortcut it returns in the same screen but the pid of the process is killed.
BUT
if i hold home button and choose my app from there it will resume normally
This problem is not happenig in all devices 2.2.1 and 2.3.5 samsung galaxy Ace
if is solved again ( i doubt i lost many hours searcing) please link the answer
Thanks in advance
EDIT
In 2.3.6 Samsung Nexus S doesn't happen.
You shouldn't worry about that. The whole Android ecosystem is built around the concept of never terminating your application yourself, and letting the OS handle that aspect of things, and it's working very well if your app is written following the good practices.
Make good use of the Activities lifecycle methods (onPause, onResume, onStop, etc.), and everything will work smoothly, whether your app has been effectively terminated or kept in the background by Android.
When debugger is connected, one of my activities in an Android app is displayed as a black screen. When I run the application without debugger, everything is working normally. If debugger is connected and then I disconnect it, black screen disappears and ui is displayed normally.
Any ideas why that might be?
I reproduced the problem on two phones. Restarting the phone, uninstalling app, cleaning the project didn't do anything for me.
EDIT: onCreate() in the black screen activity doesn't even get called.. though the startActivity(intent) for it gets called.
Its not like that...Usually when you debug the application it will be very slow when compared to the normal behavior. You might be performing any task in onCreate() method that takes a bit time to execute. Until that is done UI wont be display.
I suggest you to keep some debug breakpoints and analyse where it is taking much time...
This also happened to me. Black screen after calling start activity and the onCreate of the next activity is not reached.
What I did was remove all the breakpoints on the called activity and all is good.
I have no idea what happened. I was using it normally just yesterday, today every time I turn on a VM, it keeps going on with the loading animation (upwards of 10 minutes). The VMs were never slow on my pc (Core i7). In under two minutes, it would completely load with all the applications installed. I don't have any errors because it either ends up crashing completely or the VM loads but is immensely slow` ,such that I would get messages similar to :
Virtual Machine has stopped responding.
EDIT: I tried turning it on again. After 30 minutes the VM loaded with a blank screen. Then when I tried to click on a button in the keypad, it went back to the loading screen.
EDIT: It turned on now but it is slower than anything I have ever experienced before. My AVM was NEVER this slow. I unlocked the phone and this message popped up: "Process system is not responding." I have two options "wait" or "ok". After I clicked Wait, I could interact a bit with it, but then a second message popped up "Unfortunately the launcher has stopped." and I'm back on the main screen.
I found the answer. I accidentally deactivated the high-performance mode on my laptop. I re-activated it and now it seems to be back to normal.