The problem with bind/unbind - is that when the activity finishes the
service gets stopped.
I want the service to be around - even if the mainactivity is killed.
in the Activity.onCreate() i do
Intent requestIntent = new Intent(this, MainService.class);
The problem with bind/unbind - is that when the activity finishes the
service gets stopped.
I want the service to be around - even if the mainactivity is killed.
I kill the mainactivity by going to the active app list and removing it.
Then when I go to the phone SettingsApps and look at the
On Fri, Jan 31, 2014 at 8:19 AM, dashman erjdri...@gmail.com wrote:
The problem with bind/unbind - is that when the activity finishes the
service gets stopped.
I want the service to be around - even if the mainactivity is killed.
Ah. Well, a little hacky, but you could save a boolean
Absolutely - happy to explain.
My service can be started at phone bootup - works wonderfully.
Now when the user starts my app (Activity) - in the onCreate method
i want to see if the service is running - if not running - i want to run it.
I've taken your advice and in the
I was asking more along the lines of what is your service actually doing.
What is its purpose that requires this limitation? Is it a long-running
task it's executing or something quick?
In any case, on further thought: Service.onCreate() should only be called
if the service is not already
I am calculating the screen size in inches as the following:
DisplayMetrics dm = new DisplayMetrics();
if (Build.VERSION.SDK_INT = Build.VERSION_CODES.JELLY_BEAN_MR1) {
getWindowManager().getDefaultDisplay().getRealMetrics(dm);
} else {
The service doesn't do much right now - in fact I'm not creating a worker
thread in onStartCommand()
But it is a listener for some system callbacks - but later I might add a
worker thread - will always be running.
Basically I want a single instance of the service running all the time.
I read
What's confusing is this.
I've got the app and service running.
Then using the active app-list option of the launcher, I remove the app.
I would think this would kill the app - but not the service.
Service.onDestroy() is not called.
But now if I restart the app - the Service.onCreate() is
2014-01-31 dashman erjdri...@gmail.com:
What's confusing is this.
I've got the app and service running.
Then using the active app-list option of the launcher, I remove the app.
I would think this would kill the app - but not the service.
Service.onDestroy() is not called.
But now if
I think your analysis is correct.
I also think it happens because my service doesn't create a worker thread.
In the onStartCommand() method - it sets up some system listeners and
returns STICKY.
So when the main app is being killed (when i remove it from the active apps
list) - i think the
Short answer to the subject line:
private boolean isMyServiceRunning() {
ActivityManager manager = (ActivityManager)
getSystemService(this.ACTIVITY_SERVICE);
for (RunningServiceInfo service :
manager.getRunningServices(Integer.MAX_VALUE)) {
if
On Fri, Jan 31, 2014 at 8:25 PM, pskr pskrt...@gmail.com wrote:
Is there a better way? Works for few other devices I have. Is SGH-I727
reporting incorrect values?
Yes, I'm afraid. I have tried to solve the same problem and failed to find
a solution. The issue has been discussed here already
How many threads a service / process has inside does not have any effect
on how likely it's to be killed.
You should expect that your app's entire process, including any services
(and threads, of course) can be killed by the system any time.
Now since you mentioned swiping -- in case you're
yes this is on 4.4
i saw the startForeground API call - but my service really is a background
service...
but i guess i'll have to use that now.
On Friday, January 31, 2014 3:34:41 PM UTC-5, Kostya Vasilyev wrote:
How many threads a service / process has inside does not have any effect
calling startForeground() seems to have done the trick.
Not entirely comfortable because it's not a foreground service - but it
does need to be there on at least until the user tells it to stop -
I hope it's not eating up too much resources.
Thanks everyone.
--
You received this
I'd say trying STICKY and be careful to not swipe your app from the recents
list (which kills the process... can be a support issue).
-- K
2014-02-01 dashman erjdri...@gmail.com:
yes this is on 4.4
i saw the startForeground API call - but my service really is a background
service...
but
Prezados, boa noite.
Qual APIs vocês usam para download de videos assíncrono? Terei um GridView
de videos e preciso fazer o carregamento assíncrono dos mesmos.
Obrigado.
--
http://about.me/dnassuncao
Diêgo Nunes Assunção
Give Peace a Chance
--
You received this message because you are
17 matches
Mail list logo