Toast method is used to display messages in Android.
It can only display String Variables.
To display any Integer variable value convert the Integer into String.
Example
int x=10;
String a=""+ x;
Toast Method Syntax:
Toast.makeText("classname.this",a,2000).show();
It will display String 'a' for 2secs.
It can only display String Variables.
To display any Integer variable value convert the Integer into String.
Example
int x=10;
String a=""+ x;
Toast Method Syntax:
Toast.makeText("classname.this",a,2000).show();
It will display String 'a' for 2secs.