• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Application close when back button is pressed

 
Jeyaganeshan Jeyatharsini
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I opened browser from my application. To do that I finish my activity. If not app crashes. But now when I press back button my whole application closes. How to avoid it?
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you don't want the app to close, why are you finishing the activity? That's the consequence.
 
Jeyaganeshan Jeyatharsini
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But if I don't close, then application crashes... how to resolve it?
 
Dave Tolls
Ranch Hand
Posts: 2112
16
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeyaganeshan Jeyatharsini wrote:But if I don't close, then application crashes... how to resolve it?


Then that is your problem, not the back button one.

What error shows up in your logs?
 
Jeyaganeshan Jeyatharsini
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can't I use flags constants? If so which constant?
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, you need to investigate why the app crashes, as Dave suggested. Start by answering the question he asked - post the full stack trace here.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic