MAD Practical 17
MAD Practical 17
XML Code
<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">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
Java Code
package com.example.gmail.practical17;
Toast.makeText(this,"on create",Toast.LENGTH_SHORT).show();
@Override
Toast.makeText(this,"on start",Toast.LENGTH_SHORT).show();
@Override
Toast.makeText(this,"on Resume",Toast.LENGTH_SHORT).show();
@Override
Toast.makeText(this,"on pause",Toast.LENGTH_SHORT).show();
@Override
Toast.makeText(this,"on stop",Toast.LENGTH_SHORT).show();
@Override
Toast.makeText(this,"on destroy",Toast.LENGTH_SHORT).show();
@Override
protected void onRestart() { super.onRestart();
Toast.makeText(this,"on Restart",Toast.LENGTH_SHORT).show();
Output