HOW TO CREATE TOAST FOR YOUR ANDROID APPS :
- Make function that showing toast in YourActivity.java
- Toast syntax :
Toast toastname = Toast.makeText(getApplicationContext(),text,Toast.LENGTH_LONG/SHORT);
The text (parameter) is in string format. The length is used to set how long the toast will be showing on the screen.
- To show toast on the screen, use show() method to toast object.
- Call the function in your UI (activity_main.xml).
Recent Comments