0

this exception or java number null pointer exception always happen to my application. i surrounded try...catch... but yet still appear this.

try{

} catch (Exception ex) {
                    toast = Toast.makeText(Main_ParticularCategoryAllNews.this,
                            Config_ConstantVariable.warnmsg_serverwifidown,
                            Toast.LENGTH_SHORT);
                    toast.setGravity(Gravity.CENTER_VERTICAL
                            | Gravity.CENTER_HORIZONTAL, 0, 0);
                    toast.show();
                }

So how to disable this?

Alan Lai
  • 1,094
  • 7
  • 18
  • 41

2 Answers2

0

The exception is already being handled by the Toast, so it doesn't reach your catch statement. I'm guessing that's some error handling by the device you're using already, so most probably you don't have a choice but to find why and where that Toast appears, and fix that.

josephus
  • 8,284
  • 1
  • 37
  • 57
0

Check the following and try to implement according to the guide line of stack over flow users

Android Database Locked

Failed to open Database in android app

Community
  • 1
  • 1
user1203673
  • 1,015
  • 7
  • 15