views:

98

answers:

2

Hi all,

I have an app that has a widget. In the main app, I have an ad framework (cannot be edited due to licence) that is accumulatively leaking approx 1MB every time I exit the app. It appears one of its threads are running in the background (unnecessarily) that will keep its process and these threads will be created again when I launch the app.

Is it a good idea to call

android.os.Process.killProcess(android.os.Process.myPid());

in the onDestroy method of my main activity?

Also, would doing this kill my widget's service as well?

A: 

Maybe you are suffered by some static variable problem.. aren't you? only you can solve this problem to use onDestory() callback. if you find some good idea. plz reply this comment.

Thank you

Taylor
A: 

Hi, you can use the intent concept to use the background processing or u can also develop service that will be executing your third party framework in background.

Rakesh Gondaliya
Thank you for you response, the frame work is an ad framework, therefore, it should load a new one every time and my users don't like having apps running in the background constantly. Also, the ad uses like 10% of the cpu every 3 seconds. I need a way to kill it and my code above seems to work
zsniper