views:

17

answers:

0

Hi i am new to the android programming.i am working on a image viewer application through which we can view the images(these images i hav already stored in an array).firstly i am using a grid view to view my images in a grid form.later if the user clicks a particular image then that image alone shall be visible.for that we need to handle the image in another activity with an addition of three more buttons.a previous and next button to toggle between the images.And a back button to go back to the grid view.but how to handle this imageview object in another activity when i am not able to send this imageview object to another activity. I ll show you my code "Imager.java" for getting the grid view.

   public void onCreate(Bundle savedInstanceState) 

  {

  super.onCreate(savedInstanceState);

  setContentView(R.layout.main);

  gridview = (GridView) findViewById(R.id.gridview);

  imageAdapter =new ImageAdapter(this);

  gridview.setAdapter(imageAdapter);

  }

where the imageAdapter is my collection of imageView objects.

I hav written the code for ImageAdapter class in another activity named "ImageAdapter.java". which uses the getView() method to set the images in the array into the imageView object.

Currently i am using this code but i am not able to go back to the grid view again whenever i press the return button on phone.

Also there lies another problem.If i am using images of resolution of almost 150*150 then i am using linear layout to view them individually in another screen.But if i am using images of almost 300*300 resolution then they are not appearing at one place.every image keeps on shuffling from its desired position.i hav also tried absolute layout for this but the same thing happens.images are not fixed to center