RecyclerViewActivity
package com.example.firstapp.recyclerview; import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.Button; import com.example.firstapp.R; import com.example.firstapp.gridview.GridViewActivity; public class RecyclerViewActivity extends AppCompatActivity { private Button mBtnLinear; private Button mBtnHor; private Button mBtnGrid; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView( R.layout.activity_recycler_view); mBtnLinear=findViewById( R.id.btn_linear ); mBtnLinear.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { Intent intent=new Intent(RecyclerViewActivity.this,LinearRecyclerViewActivity.class); startActivity(intent); } } ); mBtnHor=findViewById( R.id.btn_hor ); mBtnHor.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { Intent intent=new Intent(RecyclerViewActivity.this,HorRecyclerViewActivity.class); startActivity(intent); } } ); mBtnGrid=findViewById( R.id.btn_grid ); mBtnGrid.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { Intent intent=new Intent(RecyclerViewActivity.this, GridRecyclerViewActivity.class); startActivity(intent); } } ); } }