Hi!
I have implemented a service which reacts on incoming calls and sms.
After a while running, the service seems to be running (explained
later why i know this) but it don´t react on incoming calls or sms? If
i want then to stop the service, i get an error message (only that the
application must be stopped).
I have 2 Buttons, one for start and one for stopping the service in an
activity. This activity then starts the service. In the service in the
method onStart() i start the listeners:
smslistener = new SMSListener();
registerReceiver(smslistener, new IntentFilter
("android.provider.Telephony.SMS_RECEIVED"));
In the activity i look if the service is running and disable or enable
the start and stop button:
boolean isrunning = false;
List<ActivityManager.RunningServiceInfo> list =
am.getRunningServices(99);
for(RunningServiceInfo service:list)
{
if(service.process.equals("com.myapp.rn") &&
service.started==true)
{
isrunning = true;
break;
}
}
When the service does not inform about incoming sms/calls and i start
the activity, then the stop button is activated therefore i can say
that the service is still running!? So may it is false to start the
listeners where i do?
Or what could be the problem that the service seems to be running, but
it don´t react?
Thank you
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---