Skip to content

Commit

Permalink
added read permission
Browse files Browse the repository at this point in the history
  • Loading branch information
bhavesh-hirpara committed May 6, 2014
1 parent dc1ea33 commit f5d29d5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
4 changes: 3 additions & 1 deletion AndroidManifest.xml
Expand Up @@ -8,6 +8,8 @@
android:minSdkVersion="7"
android:targetSdkVersion="17" />

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
Expand All @@ -32,4 +34,4 @@
</activity>
</application>

</manifest>
</manifest>
2 changes: 1 addition & 1 deletion project.properties
Expand Up @@ -11,5 +11,5 @@
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt

# Project target.
target=android-8
target=android-19
android.library=false
2 changes: 2 additions & 0 deletions src/com/luminous/pick/CustomGalleryActivity.java
Expand Up @@ -188,6 +188,7 @@ private ArrayList<CustomGallery> getGalleryPhotos() {
Cursor imagecursor = managedQuery(
MediaStore.Images.Media.EXTERNAL_CONTENT_URI, columns,
null, null, orderBy);

if (imagecursor != null && imagecursor.getCount() > 0) {

while (imagecursor.moveToNext()) {
Expand All @@ -197,6 +198,7 @@ private ArrayList<CustomGallery> getGalleryPhotos() {
.getColumnIndex(MediaStore.Images.Media.DATA);

item.sdcardPath = imagecursor.getString(dataColumnIndex);

galleryList.add(item);
}
}
Expand Down
9 changes: 5 additions & 4 deletions src/com/luminous/pick/MainActivity.java
@@ -1,5 +1,7 @@
package com.luminous.pick;

import java.util.ArrayList;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
Expand All @@ -11,14 +13,13 @@
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.ViewSwitcher;

import com.nostra13.universalimageloader.cache.memory.impl.WeakMemoryCache;
import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.ImageLoaderConfiguration;
import com.nostra13.universalimageloader.core.assist.ImageScaleType;

import java.util.ArrayList;

public class MainActivity extends Activity {

GridView gridGallery;
Expand All @@ -39,8 +40,8 @@ public void onCreate(Bundle savedInstanceState) {
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.main);

initImageLoader();
init();
initImageLoader();
init();
}

private void initImageLoader() {
Expand Down

0 comments on commit f5d29d5

Please sign in to comment.