On Mon, Mar 2, 2009 at 4:36 PM, Bnet <tcb...@gmail.com> wrote: > > Okay Thanks. In regards to having a Context to call startActivity(), > does it make sense to move the SoundNotification to the > ServiceReceiver as shown below? I can't seem to basically call a > subroutine. > > public class ServiceReceiver extends BroadcastReceiver { > > �...@override > public void onReceive(Context context, Intent intent) { > > MyPhoneStateListener phoneListener=new MyPhoneStateListener(); > TelephonyManager telephony = (TelephonyManager) > context.getSystemService(Context.TELEPHONY_SERVICE); > telephony.listen > (phoneListener,PhoneStateListener.LISTEN_CALL_STATE); > > > Intent i = new Intent > ("com.bnet.detectmissedcall.SoundNotification"); > context.startActivity(i); > > > } > }
I'm not sure what you're trying to do there. You're still creating your PhoneStateListener locally in your Receiver, which is not a good idea. It might help if you tell us what you're actually trying to do. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---