Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Problem in starting activity from broadcast receivers

 
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Rancher
Posts: 1369
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
After you intercept the SCREEN_OFF broadcast and start your activity does the screen turn on?
 
Hardik Trivedi
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic