Volume Bug (Solved)

I can’t believe I fixed this bug! I actually fixed two bugs at once. They were very related. My app had tasks running in the background and that was causing some strange bugs. I fixed it like this:

It turns out that something was causing a task to not be killed. It was bugging the phones volume and the app was running in the background and consuming RAM and battery. I solved it by killing the all the tasks myself.

Add KILL_BACKGROUND_PROCESSES to the manifest. Then kill the tasks.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


@Override
 protected void onDestroy() {
 // TODO Auto-generated method stub
 super.onDestroy();
 final ActivityManager amm = (ActivityManager) WebViewPager.this.getSystemService(Activity.ACTIVITY_SERVICE);
 amm.restartPackage("com.liyicky.dbzhd");
 amm.killBackgroundProcesses("com.liyicky.dbzhd");

}

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I’m so happy I solved this bug, it was extremely frustrating. It’s not good to have an app with such a huge bug on the market.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s