I want to show custom toast to users. But toast.getView() and toast.setView() is deprecated in android studio.
Here is my code:
Toast toast = Toast.makeText(context, "Show Toast", Toast.LENGTH_LONG);
View view = toast.getView();
view.setBackgroundResource(R.drawable.toast_background);
TextView text = view.findViewById(android.R.id.message);
text.setTextColor(Color.WHITE);
text.setPadding(15,0,15,0);
toast.show();
Now, how to customize toast in android studio(java)?