1

I faced some strange case from my android app.

I made a simple app which has two activities and one is LoginActivity and another one is MainActivity. The android app works without any problem on Debugging mode on the PC as following code.

Intent intent = new Intent(LoginActivity.this,MainActivity.class);

startActivity(intent);

LoginActivity.this.finish();

And I published on google play store. But I met some problem. When I click app icon on my phone, the app always back to LoginActivity and this case never happened on debugging mode

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
Taylern
  • 116
  • 1
  • 13
  • Sounds like you need to add a Flag to the intent to clear the stack when you start the MainActivity, or change the manifest so that the login activity doesn't have a parent of the login activity – OneCricketeer Sep 12 '16 at 01:41
  • According to this, finishing the activity should work. http://stackoverflow.com/questions/8631095/android-preventing-going-back-to-the-previous-activity – OneCricketeer Sep 12 '16 at 01:42
  • in my app i only call `finish()` and it works with the release key, i don't use `LoginActivity.this.finish();` i don't know if this is the problem but give it a try – Tiago Oliveira Sep 12 '16 at 01:56
  • Thanks all, I want to know that it works well at debugging mode but why this problem happen when I installed the published app. – Taylern Sep 12 '16 at 02:08

0 Answers0