Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7905857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T10:39:52+00:00 2026-06-03T10:39:52+00:00

I have built a simple Android application to solve an annoying problem. Whenever you

  • 0

I have built a simple Android application to solve an annoying problem. Whenever you join the wireless network at my University you are redirected to a log in page where you must provide your student number and password.

I have build an Android application that lets you enter your details, a service then registers a receiver with the intent filter WifiManager.NETWORK_STATE_CHANGED_ACTION.
Whenever the device connected to the University network a HTTP post webrequest is made with the log in details. Thus solving the problem of being redirected.

Everything works perfectly… However in my extended testing I found a very weird issue. When I press the “Go Power Master” applications lightning button once and then open Settings>Apps>Running I see my service is restarting (along with many other services for example Facebook). After about 30 seconds the Services restart and everything is fine once more.

However if I press the lightning button many times (3 or more) in quick succession and then go to Settings>Apps>Running I no longer see my Service. Its like it has never tried to restart. The Facebook Service and other Services go thru the normal restarting phase and eventually succeed.

Does anyone know what is going on? Why is my Service dying forever when I press the lightning button multiple times?

Before you answer know that I have changed my application to work with startForeground() and this works perfectly in all my extended testing. This is however not a valid solution because I don’t want my application to have a constant notification in the status bar.

P.S. My project is up on github if you would like to recreate this weird issue https://github.com/ccoffey/NUIMWiFi

P.P.S. The “Go Power Master” application is a free application on Google Play, the lightning button is supposed to reclaim lost RAM? I guess it forces all background Services to die. This is certainly what it appears to do anyway.

Edited to include LogCat logs

Okay I have partially answered my own question. Below is the LogCat output for my Service filtered to only include ie.cathalcoffey.android. I have highlighted the lines that matter. It turns out that each time you kill a Service its restart time increases. Initially it was 135096ms, the second time I killed the Service it became 540384ms and the final time I killed the Service it became 2161536ms.

So now I know why my Service appears to not restart after being killed many times in quick succession. I still don’t know why the Facebook Service restarts very quickly every time its killed (no increase in restart time). Any ideas on how to solve this?

05-08 09:52:20.997: I/ActivityManager(192): START   
{act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] 
flg=0x10000000 cmp=ie.cathalcoffey.android/.MyActivity} from pid 3364 05-08 
09:52:21.403: I/ActivityManager(192): Displayed 
ie.cathalcoffey.android/.MyActivity: +290ms (total +41s557ms) 05-08
 09:53:01.888: I/ActivityManager(192): Killing proc 
3330:ie.cathalcoffey.android/10033: kill background 05-08 09:53:01.888: 
W/ActivityManager(192): Scheduling restart of crashed service 
ie.cathalcoffey.android/.MyService in 135096ms 05-08 09:55:17.013: 
I/ActivityManager(192): Start proc ie.cathalcoffey.android for service 
ie.cathalcoffey.android/.MyService: pid=3633 uid=10033 gids={3003} 05-08 
09:56:21.325: I/ActivityManager(192): Killing proc 
3633:ie.cathalcoffey.android/10033: kill background 05-08 09:56:21.333: 
W/ActivityManager(192): Scheduling restart of crashed service 
ie.cathalcoffey.android/.MyService in 540384ms 05-08 10:05:21.747: 
I/ActivityManager(192): Start proc ie.cathalcoffey.android for service 
ie.cathalcoffey.android/.MyService: pid=3943 uid=10033 gids={3003} 05-08 
10:17:20.786: I/ActivityManager(192): Killing proc 
3943:ie.cathalcoffey.android/10033: kill background 05-08 10:17:20.786: 
W/ActivityManager(192): Scheduling restart of crashed service 
ie.cathalcoffey.android/.MyService in 2161536ms

Okay so filtering LogCat with facebook returns the following interesting information, again the interesting stuff is in bold. How are they doing this? How do I incorporate this no-kill logic into my Service.

05-08 10:47:15.896: I/ActivityManager(192): Killing proc 
4530:com.facebook.katana/10077: kill background 05-08 10:47:15.896: 
W/ActivityManager(192): Scheduling restart of crashed service 
com.facebook.katana/.service.MediaUploadService in 24955ms 05-08 
10:47:16.552: W/ActivityManager(192): Permission Denial: Accessing service
ComponentInfo{com.facebook.katana/com.facebook.katana.service.MediaUploadService } from pid=907, uid=10069 that is not exported from uid 10077 05-08 10:47:16.560: W/System.err(907): java.lang.SecurityException: Not allowed to stop service Intent { cmp=com.facebook.katana/.service.MediaUploadService } 05-08 10:47:17.263: W/System.err(907): java.lang.SecurityException: Not allowed to stop service Intent { cmp=com.facebook.katana/.service.MediaUploadService } 05-08 10:47:17.263: W/ActivityManager(192): Permission Denial: Accessing service ComponentInfo{com.facebook.katana/com.facebook.katana.service.MediaUploadService} from pid=907, uid=10069 that is not exported from uid 10077 05-08 10:47:17.778: W/System.err(907): java.lang.SecurityException: Not allowed to stop service Intent { cmp=com.facebook.katana/.service.MediaUploadService } 05-08 10:47:17.778: W/ActivityManager(192): Permission Denial: Accessing service ComponentInfo{com.facebook.katana/com.facebook.katana.service.MediaUploadService} from pid=907, uid=10069 that is not exported from uid 10077
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T10:39:54+00:00Added an answer on June 3, 2026 at 10:39 am

    The solution was to add exported=”false” to the service in the AndroidManifest.xml

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple Android application that uses a JAR I have built. When
I have built a very simple blog application using Ruby on Rails. New to
I have a cakePhp application built, and now I'm creating a simple blog based
I am very much an Android newbie and I have built a simple RSS
I have built a simple menu in jQuery http://vanquish.websitewelcome.com/~toberua/ Here is a sample of
I have built a pretty simple REST service in Sinatra, on Rack. It's backed
Does Python have a built-in, simple way of encoding/decoding strings using a password? Something
I have a simple web app built in asp.net webforms c# where and how
I want to build a fairly simple Android application. The basic data model of
I am trying to write a simple Android application using the NDK and C++.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.