Skip to content

Instantly share code, notes, and snippets.

@Yousha
Last active June 16, 2020 08:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Yousha/f603d632db515512d1bccca67dffc82f to your computer and use it in GitHub Desktop.
Save Yousha/f603d632db515512d1bccca67dffc82f to your computer and use it in GitHub Desktop.
Improved Android Toast.
public static final void iToast(final Activity context, final String message)
{
context.runOnUiThread(new Runnable()
{
@Override
public void run()
{
Toast.makeText(context.getApplicationContext(), message, Toast.LENGTH_LONG).show();
}
});
return;
}
public static final void iToast(final Activity context, final int resourceId)
{
Util.iToast(context, context.getApplicationContext().getResources().getString(resourceId));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment