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
I ended up having to get rid of the dialog = null. I also had to move the switching between activeTextView from onCreateDialog(int id) to onPrepareDialog(int id, Dialog dialog).
Below is the updated code.
@Override
protected Dialog onCreateDialog(int id) {
super.onCreateDialog(id);
Dialog dialog = null;
switch(id){
case 1:
dialog = new CustomCalcDialog(this);
dialog.setTitle("Enter Shipping %");
break;
case 2:
dialog = new CustomCalcDialog(this);
dialog.setTitle("Enter Tax Rate");
break;
case 3:
dialog = new CustomCalcDialog(this);
dialog.setTitle("Enter Commission %");
break;
case 4:
dialog = new CustomCalcDialog(this);
dialog.setTitle("Calculate Subtotal");
break;
case 5:
dialog = new CustomCalcDialog(this);
dialog.setTitle("Additional Shipping");
break;
case 6:
dialog = new BackgroundOptionsDialog(this);
dialog.setTitle("Choose Background:");
break;
}
return dialog;
}
@Override
protected void onPrepareDialog(int id, Dialog dialog) {
super.onPrepareDialog(id, dialog);
switch(id){
case 1:
activeTextView = shippingPercent;
break;
case 2:
activeTextView = taxPercent;
break;
case 3:
activeTextView = commissionPercent;
break;
case 4:
activeTextView = productSubtotal;
break;
case 5:
activeTextView = addShipping;
break;
}
}