Android - Application Launchs the Main Activity always - android

We have an issue with android application. We created a Sample project which has 3 screens. LoginScreen, WelcomeScreen,HomeScreen.
When user login, will navigate to Welcome Screen and from Welcome screen place a button to navigate to Home Screen.
Application works fine as expected. We are facing an issue with the Device's Home Button. When user clicks on Home button the application quits and device home screen will appear to the user, and when the user opens the application again, the application should open the page, from where the user quits.
If the user quit from WelcomeScreen, welcome screen should be launched when the user open the app again, if its HomeScreen, then HomeScreen should be launched. When the connect the device in my laptop and try running directly application working fine as expected, but Issue is with copy paste the apk file.
If i copy the apk and paste that in my Device storage and run the application, its always opening the LoginScreen when the user quits from welcomeScreen or HomeScreen and click on the App icon again. Can you please help me to resolve this? Thank you so much.

I think you need to uninstall the application from your device delete all apk from the devices and then you should build directly into your device so that you can get the latest version of app installed in your device.Do this I hope that it will work.

Related

How to automatically restart Flutter APP if the user exits the application

I am creating a Flutter menu app android for a restaurant. The user will check the dishes on the tablet screen, if the user somehow returns to the device's home screen, I would like to restart the app automatically after some time returning to the app's home screen, for example.
I can already start the application automatically when someone turns off the device. Thanks to to everyone
The thing what you r looking is "kiosk mode". https://www.google.com/url?sa=t&source=web&rct=j&url=https://pub.dev/packages/kiosk_flutter&ved=2ahUKEwi10-jDtqHvAhWqxoUKHY5YAj8QFjAAegQIARAC&usg=AOvVaw1gwQqs5Ep1oOfjNKbv-z5-

Launcher activity reopens when it is put into background and restored to foreground by clicking launcher right after installation process

An issue is about that a launcher activity reopens when it is put into background and restored to foreground by clicking launcher. This problem occurs only after first run when a user installs an app and launch it from a play store or an android package installer.
Here are steps to reproduce the issue:
The user installs the app from the play store or android package installer;
After installation the user opens the new installed app by clicking “OPEN” inside the play store app or the android package installer;
Inside the app the user goes to another activity and put the whole app into background by pressing a home button;
The user restored the app from background by clicking the app icon and new launcher activity is created.
In a result there are 3 activities instead of 2. Back stack looks like this:
Launcher activity;
Some other activity which was started by user inside the app;
Launcher activity.
Next, when the app is removed from a recent apps` list and above steps are performed again then the app behaves exactly as expected. New back stack looks like this:
Launcher activity;
Some other activity which was started by user inside the app.
I created example app to demonstrate the issue:
source code
Here is shown installation process and a first run from the android package installer:
first run
The user starts a SecondActivity inside of the app and puts app into background. Next, the user want to restore the app back to foreground and it turns out that a FirstActivity was created again.
Here is a back stack after above steps:
back stack after first run
Now, lets run the app in standard way:
normal run
Before this test the app was removed from recent apps` list. The user starts the SecondActivity inside of the app and puts it into background by pressing home button. Next, the user restores the app back to foreground and this time the user sees the SecondActivity. The app behaves as expected now.
Here is the back stack after above steps:
back stack after normal run
The issue doesn’t refer only to my example app. It can be verified using any app from the play store. I did such test on a Netflix app which was installed from the play store (btw. the Netflix home screen isn’t visible due to security policy):
netflix first run
Here are steps:
Install the Netflix app;
Open it from the play store;
Click “HELP” button on a main screen (inside the Netflix app);
Put app into background;
Click app icon;
The user sees again the main screen instead of a help screen. The back stack looks like this:
Main screen;
Help screen;
Main screen.
It can be verified by pressing back button then the user will see each screen one by one. As we can see the Netflix app behaves identical as my example app.
Can someone explain to my why does it happen?

Home view is returned if I restore my app from apps icon android apk

When I run my apk directly in device without connecting the app to eclipse, and when I minimize my app such as pressing the home button -
if I press my app icon from opened app it will open the latest opened activity.
But if I press the icon of the app from app, the app run from the home activity.
I don't know the cause knowing that I don't override onpause or onstop or ondestroy method.
How can I resolve this issue?
Thank you

Start same android last activity on relaunch after closing the app

I am developing an app that is having function to upload images to instagram. So when i upload the image to instagram and press the home button,the app is closed and when i ma relaunching the app it is starting from the main[ splash screen] activity.
In that application i am having option to take images from gallery and the camera. So when i press the home button and relaunch the app it should start the activity where i can chose the images.
I have tried a lot. If anyone have the solution please help me out.
By default last activity will open when relaunch the app.But some device it will not happen.
I don't know the proper reason but may there is settings problem in that device.
By default the last activity will be shown when the app is restarted. Unless you have added any 'no history flag' or:
android:noHistory="true"
Set noHistory to false. ..

how to create android app that launch when device boot and block to go device home

I am trying to make an android app that will show only my app and other native app will work under my app's interface.. That means when the device starts my app will load by default and user not allowed to exit from my app by pressing any key or buttons in the device.
is there any way to do this, please help me to solve this problem.

Categories

Resources