12 |
import android.widget.BaseAdapter; |
import android.widget.BaseAdapter; |
13 |
import android.widget.GridView; |
import android.widget.GridView; |
14 |
import android.widget.ImageView; |
import android.widget.ImageView; |
15 |
|
import android.widget.Toast; |
16 |
|
|
17 |
public class ImageAdapter extends BaseAdapter { |
public class ImageAdapter extends BaseAdapter { |
18 |
//int mGalleryItemBackground; |
//int mGalleryItemBackground; |
26 |
|
|
27 |
String path = Environment.getExternalStorageDirectory().getPath() + "/Side9" ; |
String path = Environment.getExternalStorageDirectory().getPath() + "/Side9" ; |
28 |
|
|
29 |
|
|
30 |
|
|
31 |
File root = new File(path); |
File root = new File(path); |
32 |
|
|
33 |
|
if (root.exists() == false) { |
34 |
|
Toast.makeText(mContext, "Side9 folder not found on sdcard", Toast.LENGTH_LONG).show(); |
35 |
|
return; |
36 |
|
} |
37 |
|
|
38 |
File files[] = root.listFiles(); |
File files[] = root.listFiles(); |
39 |
for (File f : files) { |
for (File f : files) { |
40 |
Bitmap bmp = BitmapFactory.decodeFile( f.getPath() ); |
Bitmap bmp = BitmapFactory.decodeFile( f.getPath() ); |