how to get the arraylist on Imageswitcher view
<p>I am trying to get the images of Arraylist (here albumArrayList) to set the view in the ImageSwitcher.But not able to get the images.Please help me to solve this..Thanks..</p>

<pre><code>public class ImageViewActivity extends Activity{

    public static Gallery iGllry;
    public static ImageSwitcher imageSwitcher;
    public static ImageLoader imageLoader;

    public static ArrayList&lt;AddAlbumDetailBean&gt; album_photos1;
    public static AddAlbumDetailBean album_photo1;

    public static ArrayList&lt;Integer&gt; albumArrayList;
    public static Integer albumarrayob;

    public static ArrayList&lt;Integer&gt; albumArrayList2;
    public static Integer albumarrayob2;

    public static ArrayList&lt;Bitmap&gt; ablum_photosbit;
    public static Bitmap albmphtbit;


    public static ImageView imgvwfrgallery;
    public static GridActivity gridActivity;
    //public static int position = gridActivity.posi;

    public void onCreate(Bundle savedInstanceState){
        super.onCreate(savedInstanceState);
        setContentView(R.layout.imageviewactivity);

    iGllry = (Gallery) findViewById(R.id.img_glry);

    album_photos1 = GridActivity.albumPhotos;
    int count1 = album_photos1.size();
    Log.i("array of images", ""+ count1);
    albumArrayList= new ArrayList&lt;Integer&gt;();
    for(int i=0;i&lt;album_photos1.size();i++){
        albumArrayList.add(albumarrayob);
    }
    int count = albumArrayList.size();
    Log.i("Array of images in integer array",""+count);
    imgvwfrgallery= (ImageView)findViewById(R.id.imgvwfrgllry);
    iGllry.setAdapter(new EfficientAdapter1(this));
    iGllry.setOnItemClickListener(new OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView&lt;?&gt; parent, View v, int position,long id) {
            // TODO Auto-generated method stub
            Log.e("Enters in click event of gallery","GALLERY");
            imgvwfrgallery.setImageResource(albumArrayList.indexOf(album_photo1));
        Toast.makeText(getApplicationContext(), "Position "+(position+1), Toast.LENGTH_SHORT).show();
        } 
    });
}

public class EfficientAdapter1 extends BaseAdapter{
    private Context mContext1;
    private LayoutInflater mInflater1;
    ImageLoader imageLoader;
    int count;

    public EfficientAdapter1(ImageViewActivity imageViewActivity) {
        // TODO Auto-generated constructor stub
        mInflater1 = LayoutInflater.from(imageViewActivity);
        mContext1 = imageViewActivity;
        imageLoader = new ImageLoader(mContext1);
    }
    @Override
    public int getCount() {
        // TODO Auto-generated method stub
        Log.e("no. of photos in arraylist COUNT", ""+album_photos1.size());
        return album_photos1.size(); 
    }
    @Override
    public Object getItem(int position) {
        // TODO Auto-generated method stub
        return position;
        //return 0;
    }
    @Override
    public long getItemId(int position) {
        // TODO Auto-generated method stub
        return position;
        //return 0;
    }
    @Override
    public View getView(int position, View convertView1, ViewGroup parent) {
        // TODO Auto-generated method stub
        ImageView imageView = new ImageView(mContext1);
        album_photo1 = album_photos1.get(position);
        Log.i("album photos get view ", ""+album_photo1);
        Log.i("Position in getview ", ""+position);
        imageView.setTag(album_photo1.getUrl());
        imageLoader.DisplayImage(album_photo1.getUrl(),false,imageView);
        imageView.setScaleType(ImageView.ScaleType.FIT_XY);
        return imageView;
        } 
}
</code></pre>

<p>LOG CAT:</p>

<pre><code>07-27 11:32:01.478: WARN/dalvikvm(4539): threadid=1: thread exiting with uncaught exception (group=0x40015560)
07-27 11:32:01.508: ERROR/AndroidRuntime(4539): FATAL EXCEPTION: main
07-27 11:32:01.508: ERROR/AndroidRuntime(4539): android.content.res.Resources$NotFoundException: Resource ID #0xffffffff
07-27 11:32:01.508: ERROR/AndroidRuntime(4539):     at android.content.res.Resources.getValue(Resources.java:892)
07-27 11:32:01.508: ERROR/AndroidRuntime(4539):     at android.content.res.Resources.getDrawable(Resources.java:580)
07-27 11:32:01.508: ERROR/AndroidRuntime(4539):     at android.view.View.setBackgroundResource(View.java:7533)
07-27 11:32:01.508: ERROR/AndroidRuntime(4539):     at com.ijoomer.ImageViewActivity$1.onItemClick(ImageViewActivity.java:142)
07-27 11:32:01.508: ERROR/AndroidRuntime(4539):     at android.widget.AdapterView.performItemClick(AdapterView.java:284)
07-27 11:32:01.508: ERROR/AndroidRuntime(4539):     at android.widget.Gallery.onSingleTapUp(Gallery.java:867)
07-27 11:32:01.508: ERROR/AndroidRuntime(4539):     at android.view.GestureDetector.onTouchEvent(GestureDetector.java:557)
07-27 11:32:01.508: ERROR/AndroidRuntime(4539):     at android.widget.Gallery.onTouchEvent(Gallery.java:842)
07-27 11:32:01.508: ERROR/AndroidRuntime(4539):     at android.view.View.dispatchTouchEvent(View.java:3885)
07-27 11:32:01.508: ERROR/AndroidRuntime(4539):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:903)
07-27 11:32:01.508: ERROR/AndroidRuntime(4539):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
07-27 11:32:01.508: ERROR/AndroidRuntime(4539):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
07-27 11:32:01.508: ERROR/AndroidRuntime(4539):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
07-27 11:32:01.508: ERROR/AndroidRuntime(4539):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
07-27 11:32:01.508: ERROR/AndroidRuntime(4539):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1691)
07-27 11:32:01.508: ERROR/AndroidRuntime(4539):     at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1125)
07-27 11:32:01.508: ERROR/AndroidRuntime(4539):     at android.app.Activity.dispatchTouchEvent(Activity.java:2096)
07-27 11:32:01.508: ERROR/AndroidRuntime(4539):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1675)
07-27 11:32:01.508: ERROR/AndroidRuntime(4539):     at android.view.ViewRoot.deliverPointerEvent(ViewRoot.java:2194)
07-27 11:32:01.508: ERROR/AndroidRuntime(4539):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1878)
07-27 11:32:01.508: ERROR/AndroidRuntime(4539):     at android.os.Handler.dispatchMessage(Handler.java:99)
07-27 11:32:01.508: ERROR/AndroidRuntime(4539):     at android.os.Looper.loop(Looper.java:123)
07-27 11:32:01.508: ERROR/AndroidRuntime(4539):     at android.app.ActivityThread.main(ActivityThread.java:3647)
07-27 11:32:01.508: ERROR/AndroidRuntime(4539):     at java.lang.reflect.Method.invokeNative(Native Method)
07-27 11:32:01.508: ERROR/AndroidRuntime(4539):     at java.lang.reflect.Method.invoke(Method.java:507)
07-27 11:32:01.508: ERROR/AndroidRuntime(4539):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
07-27 11:32:01.508: ERROR/AndroidRuntime(4539):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
07-27 11:32:01.508: ERROR/AndroidRuntime(4539):     at dalvik.system.NativeStart.main(Native Method)
07-27 11:32:01.538: WARN/ActivityManager(61):   Force finishing activity com.ijoomer/.ImageViewActivity
</code></pre>
