* commit 'e771f3a67cbca9976de6b5df6088f6c007df2914': Fix NPE when showing Toast from system process.
This commit is contained in:
@ -374,8 +374,11 @@ public class Toast {
|
||||
// remove the old view if necessary
|
||||
handleHide();
|
||||
mView = mNextView;
|
||||
mWM = (WindowManager)mView.getContext().getApplicationContext()
|
||||
.getSystemService(Context.WINDOW_SERVICE);
|
||||
Context context = mView.getContext().getApplicationContext();
|
||||
if (context == null) {
|
||||
context = mView.getContext();
|
||||
}
|
||||
mWM = (WindowManager)context.getSystemService(Context.WINDOW_SERVICE);
|
||||
// We can resolve the Gravity here by using the Locale for getting
|
||||
// the layout direction
|
||||
final Configuration config = mView.getContext().getResources().getConfiguration();
|
||||
|
Reference in New Issue
Block a user