3

I made my own application, everything works fine when I debug my application from debugger, but when I create the package for release or when I upload the app on Google Store, something goes wrong.

When I launch the application from the home launcher, my app restarts from MainActivity but when I launch the app from desktop, everything works fine. It seems like there is an android bug, I can't figure it out. It happens only when I put my app on the Store.

The steps are:

  1. Install application from the store.
  2. Open the application.
  3. Put the application on background.

If I reopen the application from the Launcher ( Home ) the application restart from MainActivity ( the app is no destroyed! ), if I reopen the application from the Desktop, everything works fine and the application open the last activity that I opened.

Can anyone help me?

[Update 1]

This bug is present if i create a package and i install the application with AirDroid, everything works fine is i deploy the app directly from Xamarin. This is insane.

[ Update 2 ]

I Tried to create a new project with just two activity, MainActivity and TestActivity. MainActivity launches TestActivity when a button is pressed, if I put the app on background and resume it with launcher, this always restart the app from mainActivity with OnCreate Method called!

This is only when I create a package, when I work on debugging, everything works fine.

Where I'm wrong?

Searock
  • 6,278
  • 11
  • 62
  • 98
Gaetano Lenoci
  • 179
  • 1
  • 10

1 Answers1

0

Ok, this is a known bug, you can find all solution here: How to prevent multiple instances of an activity when it is launched with different intents

Thanks a lot to everyone for the answers!

Community
  • 1
  • 1
Gaetano Lenoci
  • 179
  • 1
  • 10