Skip to content

Instantly share code, notes, and snippets.

@dineshmm23
Last active May 15, 2019 06:11
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 dineshmm23/3239b7077920a779b0b649814f45d335 to your computer and use it in GitHub Desktop.
Save dineshmm23/3239b7077920a779b0b649814f45d335 to your computer and use it in GitHub Desktop.
class LongToastMessageShower implements MessageShower{
private Toast toast;
public LongToastMessageShower(Context appContext){
this.toast = Toast.makeText(appContext,"",Toast.LENGTH_LONG);
}
@Override
public void showMessage(String message){
toast.cancel();
toast.setText(message);
toast.show();
}
}
interface MessageShower{
void showMessage(String message);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment