Android app changes home screen on suspend - android

When I suspend my app by pressing the home button, the app immediately disappears revealing the home screen. The top-most icon on the home screen is drawn inside a white shaded box, as if the icon is somehow selected. This happens before onPause() is run but does not happen if finish() is run.
This only happens with my app. I've seen it on Android 6 and 7. What could I be doing to cause this?
More information:
I can prevent this from happening if I activate a popup menu before pressing the home button.
Still more information:
Removing the 4th line makes the problem go away. This is a TextView.
curTitle.setFocusable(true);
curTitle.setFocusableInTouchMode(true);
curTitle.requestFocus();
//curTitle.requestFocusFromTouch();
I still don't understand it.
Thanks.
https://i.stack.imgur.com/sWJCQ.png

Related

Android 5.0 Overview screen displays two snapshots when any dialog is opened

I have some dialog opened in my app. Now, when I tap Overview button(square button) the Overview screen displays two snapshots of the app(one above another). On tapping Suspend button (circle button), it works fine and I could see only one snapshot. Can anyone tell me why am I seeing this anomalous behavior and how can I fix it ?

coming back to my app from before

i try to get my app done properly but i kind of stumble upon problems all the time.
So what happens:
-> home button is pressed
-> the android menu is shown
-> i click on my app again and it just shows the appname in the actionbar and a black screen. What do i have to do to come to my starting activity again?
This screen is also shown when i press the back button. On a second tap on the back button the app closes and when i start it again it starts with my startactivity...
I really don't know what i'm doing wrong here.
I'm calling finish() in the onPause, onStop and onDestroy.

Changing Activity screen when the app is not running

How can i change the screen of an activity when pressing any button on an android phone that takes one away from the running app.
I'm trying to get a blank screen to show up on the "recents" screen, instead of a snapshot of the app.
You can use this option and check if it helps you meet your need.
android:excludeFromRecents="true"
Add this to your activities in the application manifest if you do not want the app to be shown in the recent apps list. One drawback is that you would not be able to resume the app from the Recents list. Not sure if this is what you need.
The other way is to have a 'Blank Activity', which you start when your actual activity pauses. You can then finish the 'Blank Activity' on its Resume. This way, you will have your app shown on the Recents list, but with a blank screen.
You can call finish() for activity but that will kill activity. I think that will leave blank screen. Or destroy(). Try both respond with results.
you might want to change the onpause() or onclose() functions of your app. they are the last thing android execute before leaving,therefor you can change the aspect off your app just before you leave it
EDIT :
Maybe if you create PopupWindow and set it to full screen, and color black when exiting no preview would be shown, but app would still be running (idea of user DjDexter5GH) in the onpause() and onclose() functions. therefgor,when you leave,a black(or whatever you want) screen is pushed in front
you can then close it in the onrestart(is it called this?)

Visual effects, and Activity redraw after pressing home button and come back

I am programming an Android app and it seems to work well, but when the user presses the 'home' button, and after returns to the app, the activity has changed his position some pixels, and due to this some buttons are hidden.
It only happens in some phone models , and only with visual effects enabled on the operating system.
It seems that the activity is drawn before the top bar of Android dissapears (the bar with the battery info, wifi... etc), and the activity starts to draw under the place of this bar.
What can be happening? how can I solve it?
Thank you very much!
PD: I am using a relative layout on this activity, and some layouts inside placed at top and bottom.
PD2: I forgot to tell that the app is in "no tittle bar and fullscreen".

Misplaced Layout after "home"-button and/or powersave screen

I have an app which also includes a service with a Notification.
Right now I am experiencing the foillowing problem :
I start my app which will work fine
after couple of minutes the powersave kicks in and I get a black screen
I (or hte user) click the Menu-button to dismiss the black screen and to unlock the screenlock
Now my (fullscreen) app will have "moved" like 30-40 pixels downwards, creating an ugly black border or hole. When I move the scrollwheel it will move up and down, and when I press the Menu button (showing my ap''s menu) it will "fix" the view...
or
I start my app which will work fine
I press the Home button exiting the app, my service though will (correctly) keep running
when selecting my service from the notification-bar I will get once again :
-Now my (fullscreen) app will have "moved" like 30-40 pixels downwards, creating an ugly black border or hole. When I move the scrollwheel it will move up and down, and when I press the Menu button (showing my ap''s menu) it will "fix" the view...
Any idea what the problem is ? The app is running on a ADP2 with Android 1.6
Thanks in advance !
Ok, after some testing I noticed that if I don't run the Activity on Fullscreen, but just leave the TtileBar away this won't happen...
Still this is no solution to me, I want it to be fullscreen...
Noticed siomething else, when I have the View with the black bar, and I press the home button it will "refresh" the View correctly just before actually going to the Home Screen :(

Categories

Resources