|
|
@@ -74,8 +74,10 @@ public class ToastUtils {
|
|
|
Toast mToast = Toast.makeText(context, "", Toast.LENGTH_LONG);
|
|
|
mToast.setText(text);
|
|
|
LinearLayout linearLayout = (LinearLayout) mToast.getView();
|
|
|
- TextView messageTextView = (TextView) linearLayout.getChildAt(0);
|
|
|
- messageTextView.setTextSize(20);
|
|
|
+ if(linearLayout!=null) {
|
|
|
+ TextView messageTextView = (TextView) linearLayout.getChildAt(0);
|
|
|
+ messageTextView.setTextSize(20);
|
|
|
+ }
|
|
|
mToast.show();
|
|
|
}
|
|
|
}
|
|
|
@@ -89,8 +91,10 @@ public class ToastUtils {
|
|
|
Toast mToast = Toast.makeText(context, "", Toast.LENGTH_SHORT);
|
|
|
mToast.setText(text);
|
|
|
LinearLayout linearLayout = (LinearLayout) mToast.getView();
|
|
|
- TextView messageTextView = (TextView) linearLayout.getChildAt(0);
|
|
|
- messageTextView.setTextSize(25);
|
|
|
+ if(linearLayout!=null) {
|
|
|
+ TextView messageTextView = (TextView) linearLayout.getChildAt(0);
|
|
|
+ messageTextView.setTextSize(25);
|
|
|
+ }
|
|
|
mToast.show();
|
|
|
}
|
|
|
}
|
|
|
@@ -141,8 +145,10 @@ public class ToastUtils {
|
|
|
}else{
|
|
|
mToast = Toast.makeText(context, "", length);
|
|
|
LinearLayout linearLayout = (LinearLayout) mToast.getView();
|
|
|
- TextView messageTextView = (TextView) linearLayout.getChildAt(0);
|
|
|
- messageTextView.setTextSize(25);
|
|
|
+ if(linearLayout!=null) {
|
|
|
+ TextView messageTextView = (TextView) linearLayout.getChildAt(0);
|
|
|
+ messageTextView.setTextSize(25);
|
|
|
+ }
|
|
|
mToast.setText(msg);
|
|
|
}
|
|
|
mToast.show();
|