Android :: Prevent Service From Being Restarted By System?

Sep 10, 2010

From what I can tell -- if you return START_NOT_STICKY from Service.onStartCommand(...), the system should not restart a service if it crashes. However, I'm not seeing that behavior -- any ideas on what could be restarting the service?

Android :: prevent service from being restarted by system?

Android :: Crashed Service Restarted By System Doesn't Call OnStart

Mar 31, 2009

I have noticed that if my background service crashes the system will automatically restart the service after 5 seconds. This is great, but I have noticed that only the onCreate method gets called and not the onStart method. Does this mean the service is properly restarted or do I need to do something special in the onCreate method to make sure it is? I did have my initialisation logic in the onCreate method and my starting service logic in the onStart method but it looks like it will all have to be in the onCreate method.

View 2 Replies View Related

Android :: Make Sure Service Is Restarted?

Aug 31, 2010

I have an Android application with a background running Service. When the Service crashes or gets killed by Android I can see that Android tries to restart it again. However the Service never actually restarts, I can see Android scheduling the restart but it new actually happens.

My code is as follows:.................

View 1 Replies View Related

Android :: OnStart() Not Called When Service Restarted After Being Killed?

Jul 25, 2009

I have a service that needs to hold a persistent TCP connection, think IM. I'm reluctant to use setForeground() - the service being down temporarily isn't that big a deal, and I am assume I can trust that I'll be run again once memory is available, correct? The problem here is this. The service was started via startService() before being killed. However, when it is restarted, only onCreate() is executed. This makes it hard to continue, because starting work onCreate() means I can't even bind to the service (to say query it's status) without it doing so. Is this a bug or per design? What is the status of the service after it is being restarted? Is it consider "started" by the system, i.e. waiting for a call to stopService()?

View 2 Replies View Related

HTC Incredible :: No Service And CityID Restarted?

Jun 25, 2010

This is where it gets weird. When I tried to call out from my DINC, it would start dialing, then simply stop and say "call ended". During this apparent outage, CityID (worst crapware ever!) reactivated itself after a month and a half of being done with my trial (got the DINC on 4/29). Even though my calls weren't going through, CityID was identifying the location of the numbers I was trying to call.

After a couple hours, service resumed, everything was fine and CityID stopped working again (thankfully). When I go to my call history, all the numbers that I tried to call during that time have the city and state information from CityID. All the numbers before and after do not? Weird! I thought after the two week trial it was supposed to go dormant? I hope it never reactivates again as it has never, not once, been correct regarding the location of the number calling.

View 2 Replies View Related

Android :: Service Restarted With All Unfinished Intents That Returned Start Status START_REDELIVER_INTENT?

Nov 1, 2010

Suppose you have a download service that downloads files asynchronously. For each download intent received it will put the URL of the file to download and the start ID into a job queue and return START_REDELIVER_INTENT. A worker thread then processes that list and calls stopSelf with the start ID it just processed. My question is: If the service's process gets killed and the service restarted, will the service receive all the intents (with the URLs) it hasn't called stopSelf on before it was killed or does the service receive the last intent only? It seems the API docs are ambiguous on this.

The docs say

"if this service's process is killed while it is started [...], then it will be scheduled for a restart and the last delivered Intent re- delivered to it again [...]", indicating that only the last intent gets redelivered (which would be terrible in this use case), but they also say "The service will [...] be re-started if it is not finished processing all Intents sent to it (and any such pending events will be delivered at the point of restart)."

View 4 Replies View Related

Android :: Get System Service In Personal Service?

Nov 30, 2009

I got an problem on getting the TelephonyManager in my personal service. The code as below: public class MyService extends Service {@Override public IBinder onBind(Intent intent) { return mBinder;}

View 4 Replies View Related

Android : Prevent From User To Kill This Service?

Apr 21, 2010

I have some process that i would like to run in the background the whole time.
so i made it "service".
my question is: is there anyway to prevent from the user to kill this service? (even if he uses third party app)..

View 3 Replies View Related

Android : Is There A Way To Prevent Crashed Service From Restarting

Nov 12, 2009

Is there a way to prevent your service from restarting if it crashed?

View 7 Replies View Related

Android :: Prevent App / Service From Being Killed From Task Manager?

May 7, 2010

It is very important that my service stay running until someone with a password stops the service from my UI screen. My app runs great but it is designed to be turned on/off by parents (with a password) on their kids phones. I have managed to make everything work but the problem I'm having is that if the kid uses a task manager to kill my service then my app is useless. I would be grateful to anyone who knows a way to either

1) monitor the service and start it back up automatically if its "killed"
2) prevent someone from being able to kill it except from the activity (administration screen) that launched the service. Or both?

View 2 Replies View Related

Android :: Application - Service With One Database / Prevent Locks?

Jun 8, 2010

I have android application and service that runs in separate process. Application and service read and write to same database (and same table).
What is the best way to work with database? How to prevent locks?

View 1 Replies View Related

Samsung Moment :: Under - System Select - Does - Home Only - Prevent Roaming For Voice Calls

Dec 7, 2009

Under "System select", does "home only" prevent roaming for voice calls?

View 1 Replies View Related

Android :: Bind To System Service

Mar 11, 2010

is it possible somehow to bind to private system services? What I want to do is listen to the activitymanagerservice and be notified when other activites are started. I tried implementing the IActivityController.aidl from the Sourcecode. It has methods like activityStarting and activityResuming but this didn't really work. (I used the idea from here: , problem is there is no proper private field one could use at least c.getDeclaredFields() doesn't return anything useful from the activity manager)

Any ideas how I can get notified of things going on in the Activity Manager without having to do a getRunningTasks all the time? Because this is the only workaround I came up with but it slows down the phone.


View 5 Replies View Related

Android :: Start Service Automatically On System Startup And On Installation?

Apr 9, 2009

how to define a service that launch automatically at startup and / or when installation without having to go through "activity". I look beautiful everywhere, I do found that the functions and BindService but StartService which requires action outside.

View 5 Replies View Related

Android :: Display AlertDialog As System Overlay Window From Service

Sep 28, 2010

I have issue with displaying AlertDialog from Service. I am able to display custom layout window using Toast or using WindowManager(TYPE_SYSTEM_ALERT or TYPE_SYSTEM_OVERLAY). But, I do not want to use custom layout, I prefer to use nice AlertDialog GUI directly.


Running Service. No active Activity present. On some external event, Service sends Notification
When user press Notification, Service is informed via PendingIntent and AlertDialog should be displayed (created with AlertDialog.Builder(this))

Error: ERROR/AndroidRuntime(1063): Caused by: android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application. Searching for the answer lead me to impression that I am trying something that is currently not possible (Android 2.2). Or maybe it is.

View 1 Replies View Related

Android :: System Kills Service / No Other Resource Consuming Application Is Running

Mar 9, 2010

I just would like to ask if anyone have encountered this strange behavior with other phone models or specifically HTC Tattoo wherein I have this service running for almost 5 hrs then after sometime the system kills the service. The phone does not restart actually nor any other 3rd party applicaton running in the background. Its only the service I have is running. I was wondering what were the causes that would force to close my service. Another strange thing is that before the service was closed I still can see all the logs in the logcat but after I saw that the service was closed I don't see any log information already seems like the phone was totally disconnected from my eclipse.

View 2 Replies View Related

Android :: On Screen Orientation Changes Activity Restarted

Aug 16, 2010

I know on screen orientation changes activity restarted, but suppose i don't want to restart the activity then what should I do? I had tried it by adding in manifest.xml. android:configChanges="keyboardHidden|orientation"

and override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); }

But still activity restarted each time when I change screen orientation.

View 17 Replies View Related

Android :: Can Mediaplayer Be Restarted When Surfaceview Is Being Recreated

Nov 17, 2010

I have an activity (say activity A) which displays video using a mediaplayer, rendered in a surfaceview.
The use case is to pause the video, start another activity (say activity B), then come back to activity A.
Activity A is stopped but not destroyed when going to B, which is good.

The surface view (since not visibile) IS destroyed (as observed from the notification callbacks). When coming back to activity A, and restarting the mediaplayer using start(), the media player does play back the audio, but video is not seen. Errors like this one are output on Logcat:


Unfortunately, using the new instance of SurfaceHolder as provided by surfaceCreated() doesn't help (i.e. provides the same error).

I have read in various posts a solution would be to reset the mediaplayer and restart it completely, however it is not efficient, as the end user would have to wait for the whole player preparation cycle + seekTo last position within the stream.

As shown with the fact the audio plays back, it should be a matter of plumbing between the the video decoder and the new surfaceholder/view.

What should be the best solution (best = fastest) to resume video playback when resuming the activity?

View 3 Replies View Related

Android :: Getting Network Restarted After Phone Starts Sleeping

Apr 10, 2009

I have a long lived service, it wakes up (via the AlarmManager) at intervals and connects to a web server. If the phone goes to sleep and one of my polling intervals happens the phone wakes up enough to let me attempt to connect to the network but the ConnectionManager claims there is no network. Given the system log this is correct, it was torn down. Pushing "Menu" once is enough to get the network back up and then my service can connect. How do I get the network to reconstruct itself?

View 2 Replies View Related

Android :: Application To Be Started Whenever The Phone Is Turned On Or Restarted

Sep 8, 2010

I want my application to be started whenever the phone is turned on or restarted.

View 1 Replies View Related

HTC EVO 4G :: PAW Server + Https - Restarted Application

Oct 12, 2010

I just ran across the 'PAW Server' app and it's pretty neat so far. I don't want to use it with http though, so I enabled https and restarted the app. It doesn't work at all now. I enabled bluetooth so I could manually update the config file on the sdcard and restart the server in http mode. It instantly started working again. I've tried a couple of different ports but can't get the https mode to work at all. The docs say that it will be slower which is understandable, but since it's not working at all I have to assume that I'm doing something wrong and missing something obvious. Anyone else using the PAW Server app with https enabled?

View 3 Replies View Related

HTC Droid Eris :: Phone Restarted Itself

May 10, 2010

I was on this very forum typing a reply using Uber Keyboard. I was using dolphin. All of a sudden the options screen for Uber Keyboard (BTW, I don't like it anymore. only got it for the speech to text feature) popped up and kindof self navigated to a deeper menu. I tried using the back button. This cause all of the buttons/keys to light up full brightness and then the screen went black, but the keys stayed lit. I tried pressing the end key but nothing happened. Then all of a sudden the the Android and Verizon splash logo's came up (very fast, not anywhere near as long as when you power on the phone). The phone came back to a normal state as it usually does from a power on and everything is fine.

View 2 Replies View Related

HTC EVO 4G :: Froze - Restarted - 4G Not Available - Exchange Phone?

Jun 14, 2010

I was sending a text using the shapewriter keyboard and was trying to put it to landscape mode when it wouldn't react...i was trying to press back and the phone wouldn't respond and then all of a sudden it just restarted on me...on top of that once the phone restarted I was trying to turn on 4G but I couldn't even get the option to be looked as though it was blacked out while I had no problem turning on everything is a screenshot...

I had to restart the phone in order for 4G to become available again...since then shapewriter has constantly "force close" on me...I don't know if that is the issue since I just installed it today Should I take the phone back because it just randomly restarted on me and the 4G wouldn't work? Anyone else have this happen to them?

View 2 Replies View Related

Sony Ericsson Xperia X8 :: Phone Has Restarted Itself?

Oct 27, 2010

I got an Xperia X8 on 22nd October. The phone is very good to use. Its touch response is perfect. The speed is good. But the phone restarted the first day when I played the demo video. Within 5 days the phone has restarted for about 4 times when I was playing other videos. How to get rid of this problem?

View 2 Replies View Related

Sony Ericsson Xperia X10 :: Phone Restarted Itself?

Aug 31, 2010

I was sitting at my work desk and my phone restarted itself out of nowhere. No updating was done, I was at 55% battery and it wasn't even touched. I was at my desk for about 30 minutes straight, it's laying face up and I saw the phone restart.

View 23 Replies View Related

LG Ally :: OTA 2.2 Received - Phone Restarted On Checking It

Jul 19, 2010

Yesterday I got notice that an update was avail on my Ally, but wife didn't get the message(?) so I accepted the update but was low on battery. I connected to a charger. Walked away as it was taking a wile. Forgot about it and today its acting all kind of crazy! everytime I press menu the camera pops up or it restarts! I checked and it still shows 2.1 update 1 in the phone info. Took a few times to get to it as everytime I tried to check it the phone restarted. I want to backup my messages and reformat it and see if it helps! Anyone know of a good app to backup the phone with?

View 1 Replies View Related

HTC Desire :: Browser Showing Last Opened Page When Restarted?

May 15, 2010

This is my first ever smart phone and android phone so excuse me if this is a silly question! I've noticed that after closing the web browser (well hitting the home key as there is no obvious exit option) and then re-opening it, the browser shows the page I was last at which makes me wonder if it's still running in the background and consuming battery (same with the PDF viewer). Am I right in thinking this and if so how do I close it?

View 3 Replies View Related

HTC Droid Eris :: Screen Notification About OTA And Phone Restarted?

May 25, 2010

I just did a *228 and my phone had an on screen notification (not in the bar) that said something about OTA, and my phone restarted.

View 16 Replies View Related

LG Ally :: Randomly Restarted While Browsing Internet - 3G Disappear

Sep 22, 2010

This morning my phone randomly restarted while I was browsing the internet. When I restarted it, my 3G had disappeared Icon and actual service.

View 1 Replies View Related

Sony Ericsson Xperia X10 :: Camera Crash / Phone Getting Restarted

Nov 20, 2010

I recently bought X1-mini, from the day 1 onwards, while opening the camera the phone was getting restarted (its happening sometimes)...Can anybody having this problem, i'm using Adroid2.1 update.

View 1 Replies View Related

Copyrights 2005-15, All rights reserved