Posts

Showing posts from November, 2021

How to make a toast

  Creating a TOAST has three ways: - 1. Add this in XML – android :onClick ="show"   Main Activity – fun show (view: View) {     Toast.makeText( this, "Button is clicked" , Toast. LENGTH_SHORT ).show() }   2. override fun onClick (v: View) {     Toast.makeText(v. context , "Button is clicked on interface function" , Toast. LENGTH_LONG ).show() }  

How to call Implicit Intent

Image
  ACTIVITY MAIN.XML <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:app="http://schemas.android.com/apk/res-auto"     xmlns:tools="http://schemas.android.com/tools"     android:layout_width="match_parent"     android:layout_height="match_parent"     tools:context=".MainActivity">     <ImageView         android:id="@+id/ivPhoto"         android:layout_width="270dp"         android:layout_height="450dp"         android:layout_margin="20dp"         android:scaleType="centerCrop"         app:layout_constraintBottom_toTopOf="@+id/btnchoose"         app:layout_constraintEnd_toEndOf="parent"         app:layout_constraintHorizontal_bias="0.496" ...