Android - java.lang.IllegalArgumentException Erron when creating Dialog on 2.1 and low android

前端 未结 5 1261
既然无缘
既然无缘 2021-01-23 04:27

I\'m getting the below error message from phones that are SDK version < 8. I just released this app on the android market and prior to release my test phones were a HTC Thun

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-23 04:39

    Ah, look at your code:

    dialog = new CustomCalcDialog(this);
            dialog.setTitle("Enter Shipping %");
            activeTextView = shippingPercent;
            dialog.show();
            dialog = null;
            break;
    

    You set dialog to null: that's why you are getting the error. Do this:

    dialog = new CustomCalcDialog(this);
            dialog.setTitle("Enter Shipping %");
            activeTextView = shippingPercent;
            break;
    

提交回复
热议问题