How to Create Custom Toast in Android

Method 1 : create your own toast layout without external resources

Method 2 : You can use external libraries to make custom toast

allprojects {
repositories {

maven { url “https://jitpack.io" }
}
}
dependencies {
...
implementation 'com.github.GrenderG:Toasty:1.5.0'
}
Toasty.success(getApplicationContext(),"This is success toast",Toast.LENGTH_LONG).show();// or Toasty.error(getApplicationContext(),"This is error toast",Toast.LENGTH_LONG).show();

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store