How can we increase the font size in toast? How can we increase the font size in toast? android android

How can we increase the font size in toast?


I believe it is achieveable by this:

    ViewGroup group = (ViewGroup) toast.getView();    TextView messageTextView = (TextView) group.getChildAt(0);    messageTextView.setTextSize(25);


this is ...

 Toast toast = Toast.makeText(context, R.string.yummyToast, Toast.LENGTH_SHORT);//the default toast view group is a relativelayoutRelativeLayout toastLayout = (RelativeLayout) toast.getView();TextView toastTV = (TextView) toastLayout.getChildAt(0);toastTV.setTextSize(30);toast.show();


Here is how to do that with spans:

SpannableStringBuilder biggerText = new SpannableStringBuilder(text);biggerText.setSpan(new RelativeSizeSpan(1.35f), 0, text.length(), 0);Toast.makeText(context, biggerText, Toast.LENGTH_LONG).show();