I have simple network counter application, which has two parts A service and a view. I have a memory leak issue with my application. First I will explain my app briefly.
Service part
Service costs 2-3 Mb and in runs evertime. (starts with BOOT_COMPLETED and never die) It sends statictics to server periodically. And I dont have a memory problem with Service.
Activity part
I have a, 1 layout very simple view that shows statictics to user. If I dont add an Adview on it this view costs 3 Mb and no memory leak. If I add a AdView on it, it costs 9 Mb(11Mb with Service) on memory and CONTINUE TO GROW on every pause/resume of activity. At the and I guess system kills whole application including service And this is very bad news.
I want to completely remove this Activity when not in use. (leaving Service alive.)
How can I completely remove Activity from memory apart from service?
I guess I should have some workaround in my case.
Notes:
I dont need orientation change. it is set to portrait. btw, I really dont understand this is not fixed yet in Admob. Here is some other resources I have tried.
Android Admob 4.1.1 has a memory leak (see attached test project). Cause/fix/work around?