[android-developers] Call BroadCast Receiver

2011-09-01 Thread Chirag Raval
Hello to ereryone I want to call Brodcast Receiver from my main activity when it satisfy the particular condition. How can i achieve this ? Please help to find this solution . Please give me proper example for that. Example --- if(condition) { Here i want to call broadcast receiver

Re: [android-developers] Call BroadCast Receiver

2011-09-01 Thread MComputing Lab
You cant call a Broadcast Receiver from a class. Its called automatically when it receives the matching Broadcast. if you have written a piece of code inside an existing BroadcastReceiver, then port it to a class and use this class in your BroadcastReceiver as well as in your Activity. Regards,

Re: [android-developers] Call BroadCast Receiver

2011-09-01 Thread dnkoutso
You could also use sendBroadcast() from your Activity, which will trigger your BR. However, this might have more implication with respect to synchronous operation. I believe the sendBroadcast would be asynchronous and your BR will not execute immediately. Otherwise, I suggest doing what