0

I am new to Android and I have this issue:

I have created a tab action bar and have list items within the action bar. Now when I click on one of the list item, I want an image to be displayed in new screen. How do I do this?

  • Please show some of the code that you have so far. Unfortunately the "how do I do this, I have no idea" questions are not suitable for this site. You need to display some understanding of what you're trying to do, even if it doesn't work at all. – krillgar Apr 30 '14 at 19:38

1 Answers1

0

Create an new Activity with the image in it when the ListView was clicked. Create a listener to handle the clicks from the ListView and start the Activity from that.

ElectronicGeek
  • 3,312
  • 2
  • 23
  • 35
  • Thanks for the reply. I did that and I get a nullpointer exception. The image is not decoding here is the code for displaying the image in image view ImageView imageView = (ImageView)findViewById(R.id.image_file); String imageFileName = getIntent().getStringExtra("IMG_FILE_NAME"); Log.d("Filename in the Imageview" + TAG,TEST_IMGLOADER_PATH + imageFileName); imageView.setImageBitmap(BitmapFactory .decodeFile(TEST_IMGLOADER_PATH + imageFileName)); – user3590606 Apr 30 '14 at 20:38
  • Can you post what you did? I can't show you what's wrong if you just explain the error in one sentence. – ElectronicGeek Apr 30 '14 at 20:39
  • I'm not familiar with bitmaps being used for ImageViews. If you want, ask another question about that, I believe I answered yours. See this tutorial if you want to use their code: http://stackoverflow.com/questions/11182714/bitmapfactory-example – ElectronicGeek Apr 30 '14 at 21:03