Avoid NPE in printspooler when changing language
PrintActivity is recreated when the language setting is changed. As a result of the recreation mCurrentPrinter is null, which causes a NullPointerException when onActivityResult() is called. The issue is solved with a simple null check. Change-Id: Ic58f0ca01577d2ec02d494739f3bc2f06240dd44
This commit is contained in:
committed by
Ed Savage-Jones
parent
82eeb2f20c
commit
86d13f3daf
@@ -655,9 +655,11 @@ public class PrintActivity extends Activity implements RemotePrintDocument.Updat
|
||||
}
|
||||
}
|
||||
|
||||
PrinterId printerId = mCurrentPrinter.getId();
|
||||
final int index = mDestinationSpinnerAdapter.getPrinterIndex(printerId);
|
||||
mDestinationSpinner.setSelection(index);
|
||||
if (mCurrentPrinter != null) {
|
||||
PrinterId printerId = mCurrentPrinter.getId();
|
||||
final int index = mDestinationSpinnerAdapter.getPrinterIndex(printerId);
|
||||
mDestinationSpinner.setSelection(index);
|
||||
}
|
||||
}
|
||||
|
||||
private void startAdvancedPrintOptionsActivity(PrinterInfo printer) {
|
||||
|
||||
Reference in New Issue
Block a user