Skip to main content

Posts

Showing posts from October, 2019

Custom Toast in Android using Kotlin

Custom Toast in Android using Kotlin    In previous article we have discussed on what is Toast and its syntax check out on this link if required  What is toast  and  basic example of toast using kotlin  Toast Example  this will be continued article of previous  activity_main.xml Add the below code in your activity_main.xml file , this file contains button which on click will display the toast <? xml version= "1.0" encoding= "utf-8" ?> < LinearLayout xmlns: android = "http://schemas.android.com/apk/res/android" xmlns: tools = "http://schemas.android.com/tools" xmlns: app = "http://schemas.android.com/apk/res-auto" android :layout_width= "match_parent" android :layout_height= "match_parent" tools :context= ".MainActivity" android :orientation= "vertical" > < Button android :layout_width= ...

Toast in Android using Kotlin

                  Toast example  in Android using Kotlin       In previous article we have discussed on what is Toast and its syntax check out on this link if required  What is toast  and this will be continued article of previous  activity_main.xml Add the below code in your activity_main.xml file , this file contains button which on click will display the toast <? xml version= "1.0" encoding= "utf-8" ?> < LinearLayout xmlns: android = "http://schemas.android.com/apk/res/android" xmlns: tools = "http://schemas.android.com/tools" xmlns: app = "http://schemas.android.com/apk/res-auto" android :layout_width= "match_parent" android :layout_height= "match_parent" tools :context= ".MainActivity" android :orientation= "vertical" > < Button android :layout_width= "match_parent" ...

Toast in Android

  Toast What is Toast ? A toast is used to show small message or information for short period of time. Syntax :      Toast.makeText(this, "message or information to be displayed", Toast.LENGTH_LONG).show( ); where this - refers to the current class /context.           message - can contain any message to be displayed          Toast.LENGTH_LONG - displays the message for 4sec          or         Toast.LENGTH_SHORT - displays the message for 2sec Happy Reading 😊 Thank You Sushmitha N Hi there ! Im a experienced android developer with 4years of revelant exprience.My Skills include Android,Core Java ,Oops and Kotlin. Youtube Channel :  SDK Book