2 Replies - 10925 Views - Last Post: 18 August 2011 - 06:11 PM

#1 JeremyC  Icon User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 80
  • Joined: 12-September 10

Back button not return to main activity

Posted 18 August 2011 - 12:35 PM

Hello,

I'm having a bit of trouble with an app I'm working on.

This is my first attempt at something on in a book and it's not working they way it should, or rather the way I want it too.

When I start the app it launches fine, and I can navigate the screens. However if I'm in another activity other than the main activity it starts to act weird. If I hit the home button and then return to the app it returns me to the activity I left on however when I hit the back button it returns me to the home screen instead of the main activity. What would cause this?

I have tried it with other apps and they work correctly.

Any help would be appreciated.

Is This A Good Question/Topic? 0
  • +

Replies To: Back button not return to main activity

#2 H3R3T1C  Icon User is offline

  • Android Expert
  • member icon

Reputation: 276
  • View blog
  • Posts: 757
  • Joined: 30-March 07

Re: Back button not return to main activity

Posted 18 August 2011 - 01:00 PM

Are you calling finish(); when you launch a new activity from your main activity? If so dont call finish(); as it will dispose of that activity and now the new activity that you launch is at the bottom of the stack instead of your main.
Was This Post Helpful? 0
  • +
  • -

#3 JeremyC  Icon User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 80
  • Joined: 12-September 10

Re: Back button not return to main activity

Posted 18 August 2011 - 06:11 PM

I figured it out. Somehow it got installed twice using the ADB. I force closed both instances and uninstalled one. It seems to be working fine now.

Thank you for you reply

This post has been edited by JeremyC: 18 August 2011 - 06:12 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1