Last active
June 16, 2020 08:46
-
-
Save Yousha/f603d632db515512d1bccca67dffc82f to your computer and use it in GitHub Desktop.
Improved Android Toast.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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