Guest User

Untitled

a guest
May 27th, 2016
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. this is my mainactivity.java
  2. am sending data to another activity.
  3. private void productItemClick() {
  4. ItemClickSupport.addTo(recyclerView).setOnItemClickListener(
  5. new ItemClickSupport.OnItemClickListener() {
  6. @Override
  7. public void onItemClicked(RecyclerView recyclerView, int position, View v) {
  8. // do it
  9. Intent intent=new Intent(getApplicationContext(),DisplayProductImage.class);
  10. // Bundle bundle=new Bundle();
  11. // bundle.putInt("image",position);
  12. intent.putExtra("image",position);
  13. // intent.putExtras(bundle);
  14. startActivity(intent);
  15. }
  16. }
  17. );
  18. }
  19.  
  20. ProductDisplayActivity.java
  21. am recieving data here
  22. int image =intent.getExtras().getInt("image");
  23. imageView.setImageResource(image);
Add Comment
Please, Sign In to add comment