Please help me figure it out. We form 2 different CardView in RecyclerView . It is necessary that by clicking on the image R.drawable.e010 , for example, it switches to a new activation called e010.
@override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_engine); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recyclerView); RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(this); recyclerView.setLayoutManager(layoutManager); recyclerView.setHasFixedSize(true); MyCustomAdapter adapter = new MyCustomAdapter(initData()); recyclerView.setAdapter(adapter); FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); fab.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG) .setAction("Action", null).show(); } }); getSupportActionBar().setDisplayHomeAsUpEnabled(true); } public List<Message> initData() { Intent as1 = getIntent(); int as = as1.getIntExtra("name", -1); Toast.makeText(getBaseContext(), "Position = " + as, Toast.LENGTH_SHORT).show(); if (as==1) { list = new ArrayList<>(); list.add(new Message(R.string.like, R.drawable.e010)); list.add(new Message(R.string.like, R.drawable.e012)); list.add(new Message(R.string.like, R.drawable.e006)); list.add(new Message(R.string.like, R.drawable.e005)); return list; }else { list = new ArrayList<>(); list.add(new Message(R.string.like, R.drawable.e001)); list.add(new Message(R.string.like, R.drawable.e002)); list.add(new Message(R.string.like, R.drawable.e036)); list.add(new Message(R.string.like, R.drawable.e005)); return list; }}