Force close error

 You can add this code within oncreate method after setcontentview.....
  So now you will not get the force close error....enjoy...

        Intent next=new Intent(InsertActivity.this,act.class);       
        intent =PendingIntent.getActivity(InsertActivity.this, 0,
                    next, android.content.Intent.FLAG_ACTIVITY_NEW_TASK);
        Thread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler(){
            public void uncaughtException(Thread thread, Throwable ex){
                Log.v("MyApplication", "onUncaughtException triggered. Error:");
                ex.printStackTrace();              
                AlarmManager mgr = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
                mgr.set(AlarmManager.RTC, System.currentTimeMillis() + 2000, intent);             
                System.exit(2);

            }
       });

3 comments:

  1. You r using Alarm Service ,Right?? How to Fill this Problem In all Applications??



    And One More Doubt,

    How to set Background Images For Alert Dialog Box ??

    ReplyDelete
    Replies
    1. Have to merge this code into your code so it will solve force close error.
      And by using object name of alertdialog u can set background example(dialog.seticon,dialog.settitle so like this u have choose setbackground)

      Delete
  2. if i want to call my dashboard of application so where you pass alarm service at that place i want to pass my dashboard intent?

    ReplyDelete