Search code examples
androidforceclose

After crash App Remove Force Close Dialog in android?


i want to start another app from current app i have done everything but issue if my first app is crashing than on screen it display force close dialog i want to remove that force close dialog programmatically when i start first app from second app in android

this handler is in my other app using this if my first app was crashed than it will restart app will restart but force close dialog remain so my first app not display anything how to remove this force close dialog.

secondrunnable = new Runnable()
    {

        public void run()
        {   
            String chk=readfile();

            Log.d("chk","---->"+chk);

            if(chk.equalsIgnoreCase("off")){

                PackageManager pm = getPackageManager();
                try
                {
                    String packageName = "com.abc.def";
                    Intent launchIntent = pm.getLaunchIntentForPackage(packageName);
                    startActivity(launchIntent);

                }
                catch (Exception e1)
                {

                }

                Log.d("App Restart","---->");
            }               
            secondhandler.postDelayed(this, 20000); // for interval
        }

    };
    secondhandler.postDelayed(secondrunnable,20000);

}

Solution

  • What you are trying to do is quite easy to do with the ACRA framework. It allows for developer configurable user interactions after a crash.

    Good luck!