How to Create Custom Toast in Android

First will implement Custom Toast using method 1

Steps:

Next will implement Custom Toast using method 2

There are many external libraries to implement custom toast
but in this post we will use Toasty library. In this library there are 5 types of custom toast:
success , error , info , warning and normal

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
Ahmed Basalib

Ahmed Basalib

1 Follower

Android Developer || Web Developer || Software Engineering