1. Check out our app, Forums for Android! Download and leave feedback here!

To access child items in Image gallery view

Discussion in 'Android Lounge' started by shivasr, Sep 10, 2010.

  1. shivasr

    shivasr New Member
    Thread Starter
    25

    Sep 10, 2010
    1
    0
    25
    Hi,

    I want to auto select an image in gallery and focus the selected image. I know the position (index) of the image in gallery.

    I am trying to use

    in res/layout/main.xml

    <Gallery
    android:id="@+id/galleryView"
    android:layout_below="@id/imageViewMap"
    android:layout_width="fill_parent"
    android:layout_height="100sp"
    android:layout_weight="1"

    />

    in AlbumView.java

    gallery = (Gallery) mView.findViewById(R.id.galleryView);

    ImageView view = gallery.getItemAtPosition(position);

    Unfortunately the above code is returning null.

    Can you please help in this matter.
     

    Advertisement

  2. Steven58

    Steven58 Reformed PH
    3,933

    Feb 19, 2010
    32,944
    25,329
    3,933
    Male
    Welcome to Android Forums! Glad you signed up!

    I'll move this to where folks will see it.
     
    shivasr likes this.

Share This Page

Loading...