Code example for Gallery

Methods: setAdapter, setOnItemClickListener

0
	                                 projection, selection, selectionArgs, null );
 
		if (mCursor != null) {
			mCursor.moveToFirst();
			ImageAdapter adapter = new ImageAdapter(mCursor, _act);
			mGallery.setAdapter(adapter);
			mGallery.setOnItemClickListener(this);
 
		} else { 
			bIsNullImage = true;
		} 
 
			//showToast(this, "Gallery is empty."); 
	} 
 
 
	// After selecting the image 
	public void onItemClick(AdapterView<?> arg0, View arg1, int position, long rowId) {
 
		try {