Android main activity displays only once if the app is not closed - android

I have an app that will display the logo first, then it will go to the home activity of the app. Just like some other apps, if the app(my app) is not completely closed, even the user re-open the app(my app), the logo should not be displayed again. I mean if the user presses home button of the phone or switches to other apps, the phone will stop the app(my app) and switch back to its home or open other apps, the app(my app) is not closed. So when the user clicks the app's(my app) icon to open the stopped app, the logo should not be displayed but the home activity of the app.
I guess this should be done by using two activities. Then after 4s, it will direct the user from the logo to the home activity of the app. However, if I press home button of the phone or switch to other apps then go back to my app, the logo will be shown again but not the home activity of the app. So how to deal with this problem, or the logo activity can be done in different way?

Related

History stack cleared when clicking on recent apps button

I'm working on a launcher app that basically launches other installed apps on the device with an explicit intent and I have a edge case scenario:
An Activity (Act) creates an intent of an application (App) and starts it by calling startActivity(intent).
App get launched, my Activity going to "stop" state.
After a while I want to get back to my application so I click on "back" hard button that closes App and bring my Application to foreground (resume state).
This is the wanted behaviour.
Here is the edge case:
If I click on the "recent applications" hard button (square icon) while on App is launched, history stack is lost, and when I return to App, and click on "back" hard button - App exists to the Launcher screen and onResume of my application is being called.
I searched the web for a solution for couple of hours now, maybe I'll find a solution here.
Thanks
It seems to me you should set android:alwaysRetainTaskState true in your root activity.

how come back to Application after pressing home button

I have an android application, when user presses home or back key, android application will be minimized.
I want to open this application after pressing back or home key. (like long press in home key and selecting minimized app - I want application do this automatically).
What should I do? Please help me.
I guess what you need is Kiosk Mode.
it can disable Android features that can be used to leave your app. The following features are affected:
The back button
The home button
The recent apps button
The power button
The volume buttons

Android: How to come back directly from Gmail app to app's home screen?

In my app i am starting the gmail app directly from my app... I want when i press back navigation from action bar, home screen of app will display, instead the gmail inbox... Can any one help me how to navigate back to app's home screen(I don't want to press default back button of os) directly?
You did not write the Gmail app. It is up to the Gmail app's authors to control the behavior of the BACK button or the up affordance in the action bar in the Gmail app. You do not get a vote.

How to know if home screen currently running at the foreground

I am making a parental control app.
The user can run other program from my app.
When they hit the home button and goes to the home screen, I want my app to detect it so that it can be redirected to my app.
How can I do this?

How can I know if a user has returned to my app?

I want to know if a user has returned to my app.
I mean, if a user opens my app and then press home button (not back button) and sees his home screen then reopens my app using the launcher icon.
How can I determine that the user performed this action?
Is the onResume() method the right one for this?

Categories

Resources