You are on page 1of 2

<?xml version="1.

0"
encoding="utf-8"?> android:layout_marginBot app:layout_constraintHori
<androidx.constraintlayou tom="1dp" zontal_bias="0.498"
t.widget.ConstraintLayout
xmlns:android="http://sch android:background="#E app:layout_constraintStar
emas.android.com/apk/re 1A1A1" t_toStartOf="parent"
s/android"
app:layout_constraintBott app:layout_constraintTop
xmlns:app="http://schema om_toBottomOf="parent" _toBottomOf="@+id/imag
s.android.com/apk/res-au eView"
to" app:layout_constraintEnd
_toEndOf="parent" app:layout_constraintVerti
xmlns:tools="http://schem cal_bias="0.635"
as.android.com/tools" app:layout_constraintStar
t_toStartOf="parent" tools:ignore="MissingCon
android:layout_width="ma straints" />
tch_parent" app:layout_constraintTop
_toTopOf="parent" <ImageView
android:layout_height="m
atch_parent" tools:ignore="MissingCon android:id="@+id/imageV
straints"> iew"
tools:context=".MainActivi backgr
ty"> android:layout_width="wr
ap_content"
<Button
<androidx.constraintlayou android:layout_height="w
t.widget.ConstraintLayout android:id="@+id/b1" rap_content"

android:id="@+id/constrai android:layout_width="wr android:layout_marginTop


ntLayout" ap_content" ="149dp"

android:layout_width="0d android:layout_height="w app:layout_constraintEnd


p" rap_content" _toEndOf="parent"

android:layout_height="0 android:layout_marginBot app:layout_constraintStar


dp" tom="196dp" t_toStartOf="parent"

android:layout_marginSta android:background="@d android:background="@d


rt="1dp" rawable/shapes" rawable/viewshape"

android:layout_marginTop android:text="Next-ONE" app:layout_constraintTop


="1dp" _toTopOf="parent"
app:layout_constraintBott
android:layout_marginEn om_toBottomOf="parent" tools:src="@drawable/im
d="1dp" g1" />
app:layout_constraintEnd
_toEndOf="parent" </androidx.constraintlayo
ut.widget.ConstraintLayo public class MainActivity
ut> extends
</androidx.constraintlayo AppCompatActivity {
ut.widget.ConstraintLayo Button b1; b1.setOnClickListener(ne
ut> ImageView imageview; w View.OnClickListener()
int[] images = {
{R.drawable.img1,R.draw @Override
able.img2,R.drawable.im public void
MainActivity: g3}; onClick(View view) {
int i = 0;
package imageview.setImageReso
com.example.login_activit @Override urce(images[i]);
y; protected void i++;
onCreate(Bundle if(i == 3){
import savedInstanceState) { i = 0;
androidx.appcompat.app. }
AppCompatActivity; super.onCreate(savedInst }
anceState); });
import android.os.Bundle; }
import android.view.View; setContentView(R.layout. }
import activity_main);
android.widget.Button; b1 =
import findViewById(R.id.b1);
android.widget.ImageVie imageview
w; findViewById(R.id.image

You might also like