and i have another probelm i am unable to stop this service from other
activity
this is code i wrote . this is not stopping the service
private void StopTheftServiceRunning() {
ActivityManager manager = (ActivityManager)
getSystemService(ACTIVITY_SERVICE);
for (RunningServiceInfo service : manager
.getRunningServices(Integer.MAX_VALUE)) {
Log.i("Theft Service ", "running services "
+ (service.service.getClassName()));
if ("com.pssl.thefttracker.TheftTrackerService"
.equals(service.service.getClassName())) {
try {
Log.i("Theft Service ", "inside if ");
if (stopService(new Intent(getApplicationContext(),
service.service.getClassName().getClass()))) {
Toast.makeText(getApplicationContext(),
"Service Stopped ", Toast.LENGTH_SHORT).show();
} else {
Toast
.makeText(getApplicationContext(),
"Service can't be Stopped ",
Toast.LENGTH_SHORT).show();
}
} catch (Exception e) {
e.getMessage();
}
} else {
Log.i("Theft Service ", "inside else ");
}
}
}
i am getting the toast mesage in the else statemet of the
stopservice .
can u help me in getting this done
On Jun 10, 11:35 am, Marcin Orlowski <webnet.andr...@gmail.com> wrote:
> you cant (unless, perhaps you rooted).
> On Jun 10, 2011 7:32 AM, "kampy" <narasimha1...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Hi,
>
> > i am making an mobile theft tracker application which indeed checks
> > the sim details on boot up of the device and if the details are same
> > the service stops and if not it will start sending messages to the
> > phone numbers stored . so i want hide the service from the running
> > services list can we make service not visible to the user or can we
> > stop permissions to stop the service from there for the user . Plz
> > help me i am stuck here i need to complete it .
>
> > thanks in advance
>
> > Narasimha
>
> > --
> > 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+unsubscribe@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
No comments:
Post a Comment