I want to create a toast message with background color is white and message color is black. My toast message is:
Toast.makeText(Logpage.this, \"Please Give
static void CustomToast(Context context, String text, int duration,
@Nullable Integer backgroundColor,
@Nullable Integer textColor){
Toast t = Toast.makeText(context,text,duration);
if (backgroundColor != null)
t.getView()
.setBackgroundTintList(ColorStateList.valueOf(backgroundColor));
if (textColor != null)
((TextView)t.getView().findViewById(android.R.id.message))
.setTextColor(textColor);
t.show();
}