wood burning stoves 2.0*
The moose likes Android and the fly likes Problem in starting activity from broadcast receivers Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "Problem in starting activity from broadcast receivers" Watch "Problem in starting activity from broadcast receivers" New topic
Author

Problem in starting activity from broadcast receivers

Hardik Trivedi
Ranch Hand

Joined: Jan 30, 2010
Posts: 252
Hi all,


I am using broadcast receivers in my application. I have registered receivers in manifest and activity file. It calls perfectly. Broadcast receiver will be called whenever user clicks power button.
for that I have used

and



In onreceive of broadcast listener I am starting an activity



Now this activity is called also. But I can not see the view of an activity. Activity runs in background.

What could be the reason behind this.

Please let me know if my question is not clear.
Monu Tripathi
Rancher

Joined: Oct 12, 2008
Posts: 1369
    
    1

After you intercept the SCREEN_OFF broadcast and start your activity does the screen turn on?


[List of FAQs] | [Android FAQ] | [Samuh Varta]
Hardik Trivedi
Ranch Hand

Joined: Jan 30, 2010
Posts: 252
What do you mean by
Monu Tripathi wrote:After you intercept the SCREEN_OFF broadcast and start your activity does the screen turn on?


I am not clear.

As I have said after I intercept SCREEN_OFF I can see that my activity is called in log cat but than after android locks the screen and Activity which I have started went in background.

Actually I need to do it using back button. So can I trace the back button press event using Broadcast Receivers.
You can still ask for more elaboration.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem in starting activity from broadcast receivers
 
Similar Threads
How to retrieve string from EditText?
Broadcast Receiver and Activities
AppWidget problem
how to start application after pressing a particular number?
Application not run in the background