

We have used Toast class to display message when onCreate() and onStart() is called.īelow is the code of MainActivity. The UI will be very simple as we have just one TextView which say onStart() call after onCreate(). xml in layout folder if not present by default.

We will use Toast class to show up the message on screen.įirst create a new project, name activity as MainActivity and create a content_main. Lets create a simple program in Android that will show a message on screen when onStart() method will be called. And if user again launch the activity then onStart() method will be called. If the activity is in onPause() condition i.e.

