Android – Select multiple photos from Gallery

By -

Today I am going to discuss about implementation of selecting multiple photos from Photo Gallery. You know, I have searched enough to find out a solution for selecting multiple images from android’s native gallery. There are 2 ways to implement multi selection of images in gallery:

1) Intent for getting multiple images
2) Define custom gallery with fetching and loading photos from native gallery.

1. Intent for getting multiple images:

As being native lover, I tried to find out a solution by implementing solution provided same like we select single image from gallery, by using below code:

Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Select Picture"), PICK_IMAGE);

But I am unable to implement a solution for selecting multiple images using the above way. Yes I came to know we can use SEND_MULTIPLE intent but I am sure how do we implement this and select mutiple images. I will try to implement it and share with you if i will get success.

2. Define custom gallery with fetching and loading photos from native gallery:

As we dont know about the Intent way solution, this is the good idea for selecting multiple photos. One of my friend Vikas Kanani is already done with this solution earlier. I did thorough testing and came to know about the below issues:

  1. Images are loading very slow if we are having larger number of images, lets say 2000-5000
  2. Crashing if we load more images

For resolving above issues, what i did? I have implemented Asynchronous image loading so that every image gets loaded asynchronously.

TechnoTalkative - select multiple photos from gallery

Now, lets implement improved solution :)

Step 1: Download Image loader library from Here.

Step 2: Add the library inside the libs folder, right click on the jar file -> Select Add to Build Path

Add to build path

Step 3: Define row layout for image item
row_multiphoto_item.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >

    <ImageView
        android:id="@+id/imageView1"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:src="@drawable/ic_launcher" />

    <CheckBox
        android:id="@+id/checkBox1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignRight="@+id/imageView1"
        android:layout_centerVertical="true"/>

</RelativeLayout>

Step 4: Define activity layout with GridView
ac_image_grid.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >

    <GridView
        android:id="@+id/gridview"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:columnWidth="100dip"
        android:gravity="center"
        android:horizontalSpacing="4dip"
        android:numColumns="auto_fit"
        android:stretchMode="columnWidth"
        android:layout_above="@+id/button1"
        android:verticalSpacing="2dip" />

    <Button
        android:id="@+id/button1"
        android:layout_alignParentBottom="true"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:onClick="btnChoosePhotosClick"
        android:text="Select Photos" />

</RelativeLayout>

Step 5: Define a UILApplication to declare application level configuration settings
UILApplication.java

package com.technotalkative.multiphotoselect;

import android.app.Application;

import com.nostra13.universalimageloader.cache.disc.naming.Md5FileNameGenerator;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.ImageLoaderConfiguration;

/**
 * @author Paresh Mayani (@pareshmayani)
 */
public class UILApplication extends Application {

	@Override
	public void onCreate() {
		super.onCreate();

		// This configuration tuning is custom. You can tune every option, you may tune some of them,
		// or you can create default configuration by
		//  ImageLoaderConfiguration.createDefault(this);
		// method.
		ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(getApplicationContext())
			.threadPoolSize(3)
			.threadPriority(Thread.NORM_PRIORITY - 2)
			.memoryCacheSize(1500000) // 1.5 Mb
			.denyCacheImageMultipleSizesInMemory()
			.discCacheFileNameGenerator(new Md5FileNameGenerator())
			.enableLogging() // Not necessary in common
			.build();
		// Initialize ImageLoader with configuration.
		ImageLoader.getInstance().init(config);
	}
}

Step 6: Define a base activity to create a singleton instance of ImageLoader class.
BaseActivity.java

package com.technotalkative.multiphotoselect;

import android.app.Activity;

import com.nostra13.universalimageloader.core.ImageLoader;

/**
 * @author Paresh Mayani (@pareshmayani)
 */
public abstract class BaseActivity extends Activity {

	protected ImageLoader imageLoader = ImageLoader.getInstance();

}

Step 7: Now, Its time to define a main activity where we can write a logic for fetching photos from native gallery. Here i have also defined an ImageAdapter for the GridView.
MultiPhotoSelectActivity.java

package com.technotalkative.multiphotoselect;

import java.util.ArrayList;

import android.content.Context;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.provider.MediaStore;
import android.util.Log;
import android.util.SparseBooleanArray;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.BaseAdapter;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.Toast;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.GridView;
import android.widget.ImageView;

import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.assist.SimpleImageLoadingListener;

/**
 * @author Paresh Mayani (@pareshmayani)
 */
public class MultiPhotoSelectActivity extends BaseActivity {

	private ArrayList<String> imageUrls;
	private DisplayImageOptions options;
	private ImageAdapter imageAdapter;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.ac_image_grid);

		final String[] columns = { MediaStore.Images.Media.DATA, MediaStore.Images.Media._ID };
		final String orderBy = MediaStore.Images.Media.DATE_TAKEN;
		Cursor imagecursor = managedQuery(
				MediaStore.Images.Media.EXTERNAL_CONTENT_URI, columns, null,
				null, orderBy + " DESC");

		this.imageUrls = new ArrayList<String>();

		for (int i = 0; i < imagecursor.getCount(); i++) {
			imagecursor.moveToPosition(i);
			int dataColumnIndex = imagecursor.getColumnIndex(MediaStore.Images.Media.DATA);
			imageUrls.add(imagecursor.getString(dataColumnIndex));

			System.out.println("=====> Array path => "+imageUrls.get(i));
		}

		options = new DisplayImageOptions.Builder()
			.showStubImage(R.drawable.stub_image)
			.showImageForEmptyUri(R.drawable.image_for_empty_url)
			.cacheInMemory()
			.cacheOnDisc()
			.build();

		imageAdapter = new ImageAdapter(this, imageUrls);

		GridView gridView = (GridView) findViewById(R.id.gridview);
		gridView.setAdapter(imageAdapter);
		/*gridView.setOnItemClickListener(new OnItemClickListener() {
			@Override
			public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
				startImageGalleryActivity(position);
			}
		});*/
	}

	@Override
	protected void onStop() {
		imageLoader.stop();
		super.onStop();
	}

	public void btnChoosePhotosClick(View v){

		ArrayList<String> selectedItems = imageAdapter.getCheckedItems();
		Toast.makeText(MultiPhotoSelectActivity.this, "Total photos selected: "+selectedItems.size(), Toast.LENGTH_SHORT).show();
		Log.d(MultiPhotoSelectActivity.class.getSimpleName(), "Selected Items: " + selectedItems.toString());
	}

	/*private void startImageGalleryActivity(int position) {
		Intent intent = new Intent(this, ImagePagerActivity.class);
		intent.putExtra(Extra.IMAGES, imageUrls);
		intent.putExtra(Extra.IMAGE_POSITION, position);
		startActivity(intent);
	}*/

	public class ImageAdapter extends BaseAdapter {

		ArrayList<String> mList;
		LayoutInflater mInflater;
		Context mContext;
		SparseBooleanArray mSparseBooleanArray;

		public ImageAdapter(Context context, ArrayList<String> imageList) {
			// TODO Auto-generated constructor stub
			mContext = context;
			mInflater = LayoutInflater.from(mContext);
			mSparseBooleanArray = new SparseBooleanArray();
			mList = new ArrayList<String>();
			this.mList = imageList;

		}

		public ArrayList<String> getCheckedItems() {
			ArrayList<String> mTempArry = new ArrayList<String>();

			for(int i=0;i<mList.size();i++) {
				if(mSparseBooleanArray.get(i)) {
					mTempArry.add(mList.get(i));
				}
			}

			return mTempArry;
		}

		@Override
		public int getCount() {
			return imageUrls.size();
		}

		@Override
		public Object getItem(int position) {
			return null;
		}

		@Override
		public long getItemId(int position) {
			return position;
		}

		@Override
		public View getView(int position, View convertView, ViewGroup parent) {

			if(convertView == null) {
				convertView = mInflater.inflate(R.layout.row_multiphoto_item, null);
			}

			CheckBox mCheckBox = (CheckBox) convertView.findViewById(R.id.checkBox1);
			final ImageView imageView = (ImageView) convertView.findViewById(R.id.imageView1);

			imageLoader.displayImage("file://"+imageUrls.get(position), imageView, options, new SimpleImageLoadingListener() {
				@Override
				public void onLoadingComplete(Bitmap loadedImage) {
					Animation anim = AnimationUtils.loadAnimation(MultiPhotoSelectActivity.this, R.anim.fade_in);
					imageView.setAnimation(anim);
					anim.start();
				}
			});

			mCheckBox.setTag(position);
			mCheckBox.setChecked(mSparseBooleanArray.get(position));
			mCheckBox.setOnCheckedChangeListener(mCheckedChangeListener);

			return convertView;
		}

		OnCheckedChangeListener mCheckedChangeListener = new OnCheckedChangeListener() {

			@Override
			public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
				// TODO Auto-generated method stub
				mSparseBooleanArray.put((Integer) buttonView.getTag(), isChecked);
			}
		};
	}

}

Download this example from here: Android – Select multiple photos from Gallery

Reference: Universal Image Loader

Paresh Mayani

Paresh Mayani is a lead android developer from India. Currently, He is Sr. Software engineer at InfoStretch Solutions Pvt. Ltd. He has been developing android apps since very 1st version i.e. Android 1.5, he says he has seen days and nights of Android history. He is the Head/Organizer of Google Developers Group (GDG), Ahmedabad

  • sandip pardeshi

    thank you for sharing

    • http://www.technotalkative.com/ Paresh Mayani

      Welcome :)

  • Dan1ve

    Firstly, I want to thank you for sharing this, I really appreciate this! :)
    I’m quite unexperienced with Android programming, so please excuse my noobish question, but what would be the best way to change the size of the images in the gridview? Because on my tablet, they are displayed too small… ;)

    • http://www.technotalkative.com/ Paresh Mayani

      You are welcome.

      Regarding changing size of images in the GridView, you just need to change height/width of ImageView inside row_multiphoto_item.xml where we have defined 100dp/100dp for height/width currently, you can change it to any size you want.

      For providing compatibility, you should define different size. As you are novice android programmer i am not suggesting you to do this. But still you should read: Supporting Multiple Screens

      • Dan1ve

        Thanks again! :)
        Ah, stupid me, I was only playing around with the ac_image_grid.xml all the time…Now it works!
        It’s clear to me that you have to implement a solution for multiple screens (not the easiest task, but I will try it.)
        In general, I’m both fascinated and overchallenged at the same time with Android programming ;)

        • http://www.technotalkative.com/ Paresh Mayani

          I am glad you found it useful. As you are novice android programmer, i would suggest you to explore more articles here, there by you will explore more about android widgets and programming.

  • Carlos Navas

    You are awesome!! Right now I’m a new follower of you. Thank you very much!!!

    • http://www.technotalkative.com/ Paresh Mayani

      Thats great. Welcome.

  • Carlos Navas

    I have a little question. How can I get square images? I have different image sizes and they look ugly. Thanks in advance

    • http://www.technotalkative.com/ Paresh Mayani

      Hey Carlos, try android:scaleType=”centerCrop” attribute for ImageView.

      • praveen

        06-14 18:57:07.225: E/dalvikvm(323): Could not find class ‘com.nostra13.universalimageloader.core.ImageLoaderConfiguration$Builder’, referenced from method com.technotalkative.multiphotoselect.UILApplication.onCreate

        06-14 18:57:07.225: W/dalvikvm(323): VFY: unable to resolve new-instance 30 (Lcom/nostra13/universalimageloader/core/ImageLoaderConfiguration$Builder;) in Lcom/technotalkative/multiphotoselect/UILApplication;

        06-14 18:57:07.225: D/dalvikvm(323): VFY: replacing opcode 0×22 at 0×0004

        06-14 18:57:07.225: D/dalvikvm(323): VFY: dead code 0×0006-0038 in Lcom/technotalkative/multiphotoselect/UILApplication;.onCreate ()V

        06-14 18:57:07.225: D/AndroidRuntime(323): Shutting down VM

        06-14 18:57:07.225: W/dalvikvm(323): threadid=1: thread exiting with uncaught exception (group=0x4001d800)

        06-14 18:57:07.305: E/AndroidRuntime(323): FATAL EXCEPTION: main

        06-14 18:57:07.305: E/AndroidRuntime(323): java.lang.NoClassDefFoundError: com.nostra13.universalimageloader.core.ImageLoaderConfiguration$Builder

        06-14 18:57:07.305: E/AndroidRuntime(323): at com.technotalkative.multiphotoselect.UILApplication.onCreate(UILApplication.java:22)

        06-14 18:57:07.305: E/AndroidRuntime(323): at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:969)

        06-14 18:57:07.305: E/AndroidRuntime(323): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4244)

        06-14 18:57:07.305: E/AndroidRuntime(323): at android.app.ActivityThread.access$3000(ActivityThread.java:125)

        06-14 18:57:07.305: E/AndroidRuntime(323): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2071)

        06-14 18:57:07.305: E/AndroidRuntime(323): at android.os.Handler.dispatchMessage(Handler.java:99)

        06-14 18:57:07.305: E/AndroidRuntime(323): at android.os.Looper.loop(Looper.java:123)

        06-14 18:57:07.305: E/AndroidRuntime(323): at android.app.ActivityThread.main(ActivityThread.java:4627)

        06-14 18:57:07.305: E/AndroidRuntime(323): at java.lang.reflect.Method.invokeNative(Native Method)

        06-14 18:57:07.305: E/AndroidRuntime(323): at java.lang.reflect.Method.invoke(Method.java:521)

        06-14 18:57:07.305: E/AndroidRuntime(323): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)

        06-14 18:57:07.305: E/AndroidRuntime(323): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)

        06-14 18:57:07.305: E/AndroidRuntime(323): at dalvik.system.NativeStart.main(Native Method)

        06-14 18:59:08.045: I/Process(323): Sending signal. PID: 323 SIG: 9

        • praveen

          tell me what is the issuse.

          • siva

            how to avoid the refreshing views when scroll down and back to up? i want image has to fixed once, how to do?

  • Aditi

    Thanks for sharing… I m new in android.. I want to show selected images in imageview.. not single image.. I want to show multiple images.. Can you help me please?

    • http://www.technotalkative.com/ Paresh Mayani

      Based on the button click you can fetch URL of the images, so you can load those selected images inside ImageView same like we are displaying inside GridView.

      • Aditi

        Thanks a lot… I will try it.. :)

  • shimi

    how do you start this activity from a difrent activity

    /*private void startImageGalleryActivity(int position) {

    Intent intent = new Intent(this, ImagePagerActivity.class);

    intent.putExtra(Extra.IMAGES, imageUrls);

    intent.putExtra(Extra.IMAGE_POSITION, position);

    startActivity(intent);

    }*/

    what is the position and the Extra

    • shimi

      yes you need to add this to the code

      imageLoader.init(ImageLoaderConfiguration.createDefault(getApplicationContext()));

  • Owen

    Does your example use weak reference? When i scroll to the bottom of lets say 500 photos, anyway i can clear the memory of photos at the top?

  • Barb

    Great code, extremely helpful. May I consider the above code open source so that I can use it in my app development?

  • Anju KJ

    Paresh, I have one doubt. When I put this code into my application, I see in my logs as my url appended with width and height.

    For eg:
    Load image from Internet [my_image_url_150x150] where 150×150 stands for my width and height.

    So will this image get downloaded with url changed like this? Could you please help me out.. Thanks in advance.

    • http://www.technotalkative.com/ Paresh Mayani

      Hey dear, Have you tried at least by loading image from web? Any issue, if yes then let me know logcat output. If you want to load image only from web then here is one article with the same library: Asynchronous image loading in ListView

      • Anju KJ

        I tried with loading image on web. It didn’t open. It showed error: The requested URL url_with_extension_jpg_150x150 was not found on this server.

        My logs:

        Start display image task [url_with_extension_jpg_150x150]
        Load image from Internet [url_with_extension_jpg_150x150]
        Cache image on disc [url_with_extension_jpg_150x150]

  • Vabahv

    Thanks a lot.. MAN ….very nice code man

  • Thuita Wachira

    Hi i have had this problem for a while now, and i was wondering how to start an activity like the on above from another activity (as an intent).

    Intent M = new Intent(this, MultiPhotoSelectActivity.class) doesn’t seem to work

    • http://www.technotalkative.com/ Paresh Mayani

      doesn’t seem to work => What’s happening then? Please show me your logcat output if any issue.

      • Thuita Wachira

        Thanks for replying..this is how i fixed it though
        Intent multi_image_gallery=new Intent(this_activity,MultiGalleryActivity.class);

        startActivityForResult(multi_image_gallery,RESULT_LOAD_MULTIPLE_IMAGES);

        I dont know why passing it as this doesn’t work..its even weirder because i initialize ‘this_activity’ to ‘this’

  • Alex

    Hi,

    I want to call this activity from another activity but its not running and closes the application Unfortunately Stopped please letme know how to solve this issue. Thanks

    startActivity(new Intent(StartPage.this,MultiPhotoSelectActivity.class));

    • http://www.technotalkative.com/ Paresh Mayani

      “Unfortunately stopped” means there may be an exception, I can’t suggest you any solution without logcat output or code. There may be mistake in your code. So I would suggest you to look into logcat output and debug your code also.

      • Alex

        I want this activity to start on button click, so please let me know how to call this activity as I did the above and dint do any alterations with your code its not calling this activity

        Please help me as am new to android, also in logcat I dont know to capture which part as it is very big

        05-24 12:35:07.616: E/ActivityThread(693): Service com.android.exchange.ExchangeService has leaked ServiceConnection com.android.emailcommon.service.ServiceProxy$ProxyConnection@40d64820 that was originally bound here
        05-24 12:35:07.616: E/ActivityThread(693): android.app.ServiceConnectionLeaked: Service com.android.exchange.ExchangeService has leaked ServiceConnection com.android.emailcommon.service.ServiceProxy$ProxyConnection@40d64820 that was originally bound here
        05-24 12:35:07.616: E/ActivityThread(693): at android.app.LoadedApk$ServiceDispatcher.(LoadedApk.java:969)
        05-24 12:35:07.616: E/ActivityThread(693): at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:863)
        05-24 12:35:07.616: E/ActivityThread(693): at android.app.ContextImpl.bindService(ContextImpl.java:1418)
        05-24 12:35:07.616: E/ActivityThread(693): at android.app.ContextImpl.bindService(ContextImpl.java:1407)
        05-24 12:35:07.616: E/ActivityThread(693): at android.content.ContextWrapper.bindService(ContextWrapper.java:473)
        05-24 12:35:07.616: E/ActivityThread(693): at com.android.emailcommon.service.ServiceProxy.setTask(ServiceProxy.java:157)
        05-24 12:35:07.616: E/ActivityThread(693): at com.android.emailcommon.service.ServiceProxy.setTask(ServiceProxy.java:145)
        05-24 12:35:07.616: E/ActivityThread(693): at com.android.emailcommon.service.AccountServiceProxy.getDeviceId(AccountServiceProxy.java:116)
        05-24 12:35:07.616: E/ActivityThread(693): at com.android.exchange.ExchangeService.getDeviceId(ExchangeService.java:1249)
        05-24 12:35:07.616: E/ActivityThread(693): at com.android.exchange.ExchangeService$7.run(ExchangeService.java:1856)
        05-24 12:35:07.616: E/ActivityThread(693): at com.android.emailcommon.utility.Utility$2.doInBackground(Utility.java:551)
        05-24 12:35:07.616: E/ActivityThread(693): at com.android.emailcommon.utility.Utility$2.doInBackground(Utility.java:549)
        05-24 12:35:07.616: E/ActivityThread(693): at android.os.AsyncTask$2.call(AsyncTask.java:287)
        05-24 12:35:07.616: E/ActivityThread(693): at java.util.concurrent.FutureTask.run(FutureTask.java:234)
        05-24 12:35:07.616: E/ActivityThread(693): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
        05-24 12:35:07.616: E/ActivityThread(693): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
        05-24 12:35:07.616: E/ActivityThread(693): at java.lang.Thread.run(Thread.java:856)
        05-24 12:35:07.636: E/StrictMode(693): null
        05-24 12:35:07.636: E/StrictMode(693): android.app.ServiceConnectionLeaked: Service com.android.exchange.ExchangeService has leaked ServiceConnection com.android.emailcommon.service.ServiceProxy$ProxyConnection@40d64820 that was originally bound here
        05-24 12:35:07.636: E/StrictMode(693): at android.app.LoadedApk$ServiceDispatcher.(LoadedApk.java:969)
        05-24 12:35:07.636: E/StrictMode(693): at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:863)
        05-24 12:35:07.636: E/StrictMode(693): at android.app.ContextImpl.bindService(ContextImpl.java:1418)
        05-24 12:35:07.636: E/StrictMode(693): at android.app.ContextImpl.bindService(ContextImpl.java:1407)
        05-24 12:35:07.636: E/StrictMode(693): at android.content.ContextWrapper.bindService(ContextWrapper.java:473)
        05-24 12:35:07.636: E/StrictMode(693): at com.android.emailcommon.service.ServiceProxy.setTask(ServiceProxy.java:157)
        05-24 12:35:07.636: E/StrictMode(693): at com.android.emailcommon.service.ServiceProxy.setTask(ServiceProxy.java:145)
        05-24 12:35:07.636: E/StrictMode(693): at com.android.emailcommon.service.AccountServiceProxy.getDeviceId(AccountServiceProxy.java:116)
        05-24 12:35:07.636: E/StrictMode(693): at com.android.exchange.ExchangeService.getDeviceId(ExchangeService.java:1249)
        05-24 12:35:07.636: E/StrictMode(693): at com.android.exchange.ExchangeService$7.run(ExchangeService.java:1856)
        05-24 12:35:07.636: E/StrictMode(693): at com.android.emailcommon.utility.Utility$2.doInBackground(Utility.java:551)
        05-24 12:35:07.636: E/StrictMode(693): at com.android.emailcommon.utility.Utility$2.doInBackground(Utility.java:549)
        05-24 12:35:07.636: E/StrictMode(693): at android.os.AsyncTask$2.call(AsyncTask.java:287)
        05-24 12:35:07.636: E/StrictMode(693): at java.util.concurrent.FutureTask.run(FutureTask.java:234)
        05-24 12:35:07.636: E/StrictMode(693): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)

      • Alex

        Thanx for your reply atlast it worked, but i introduced a button in the same activity

  • Alex

    This is what am trying to do but it shows error

    select = (Button)findViewById(R.id.button2);
    select.setOnClickListener(new OnClickListener() {

    @Override
    public void onClick(View v) {

    startActivity(new Intent(sampleAct.this,MultiPhotoSelectActivity.class));

    }

  • Angsus

    Hi

    Deploy the solution to see how it works and the only problem is that I see memory cache full. 756 MB number of images 1000.

    thank you for sharing!!!!

    How I can reduce the memory??

  • chitra

    Thanks For Sharing But I got Fatal Exception Main in my Logcat. can you help me please

  • raaki##

    hey can u post a code or help me out in displaying the selected images in a separate activity