Image display Problem

All your problems with Audio, Video and Images.

Image display Problem

Postby goelsvaibhav » Mon Nov 10, 2008 12:35 pm

Hi,

I have initially taken Gridview for Layouting. In the gridview i have added the images from the SDcard and displayed them.
Now I want to show them as full image when any one of them is clicked i.e
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. gridView.setOnItemClickListener(new OnItemClickListener() {
  2.  
  3.                         @Override
  4.  
  5.                         public void onItemClick(AdapterView parent, View v, int position,
  6.  
  7.                                         long id) {
  8.  
  9.                                 try {
  10.  
  11.                                         // I am not able to convert the view clicked to an ImageView...
  12.  
  13.  
  14.  
  15.                                 } catch (Exception e) {
  16.  
  17.                                         e.printStackTrace();
  18.  
  19.                                         Log.e("Error", "exception" + e.getClass() + " " + e);
  20.  
  21.                                 }
Parsed in 0.032 seconds, using GeSHi 1.0.8.4


Since these image are stored in SDcard so i can't refer them as ImageView.setImageResource(....);

Please tell me how to proceed further.....

Thanks in advance
Vaibhav
goelsvaibhav
Junior Developer
Junior Developer
 
Posts: 19
Joined: Fri Oct 17, 2008 7:07 am
Location: Gurgaon, India

Top

Re: Image display Problem[Solved]

Postby goelsvaibhav » Tue Nov 11, 2008 6:59 am

goelsvaibhav wrote:Hi,

I have initially taken Gridview for Layouting. In the gridview i have added the images from the SDcard and displayed them.
Now I want to show them as full image when any one of them is clicked i.e
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. gridView.setOnItemClickListener(new OnItemClickListener() {
  2.                         @Override
  3.                         public void onItemClick(AdapterView parent, View v, int position,
  4.                                         long id) {
  5.                                 try {
  6.                                         // I am not able to convert the view clicked to an ImageView...
  7.  
  8.                                 } catch (Exception e) {
  9.                                         e.printStackTrace();
  10.                                         Log.e("Error", "exception" + e.getClass() + " " + e);
  11.                                 }
Parsed in 0.032 seconds, using GeSHi 1.0.8.4


Since these image are stored in SDcard so i can't refer them as ImageView.setImageResource(....);

Please tell me how to proceed further.....

Thanks in advance
Vaibhav


I have figured out this problem. Earlier i was accessing the parent view which didn't had the reference to the image.
Now I am accessing the clicked image from the SDcard by getting the path of the image which was obtained with the View was built.

Regards
Vaibhav
goelsvaibhav
Junior Developer
Junior Developer
 
Posts: 19
Joined: Fri Oct 17, 2008 7:07 am
Location: Gurgaon, India

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: No registered users and 21 guests