Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Broadcast Receiver and Activities

 
Rakesh Jhamb
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have following code in BroadCastREceiver to start an Activity



This works fine and my activity does start, but it starts on top of my main activity (which is some other activity, for example B). What I want is that from my broadcast receiver I should be able start an Activity A, such that when I press back button from there, the control should not go to B Activity.

Please let me know what I am missing.
 
Hardik Trivedi
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess that Activity B is the activity of your application only and not of other app.

How about using onBackPressed method in your activity A ???
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic