Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ImageAdapter extends BaseAdapter {
- private Context mContext;
- public ImageAdapter(Context c) {
- // TODO Auto-generated constructor stub
- mContext = c;
- shuffle();
- }
- public void shuffle()
- {
- Random rand = new Random();
- int r = rand.nextInt(3);
- String rn;
- rn=String.valueOf(r);
- Log.d("Random Number Test", rn);
- if (r==0)
- {
- mThumbIds[0]= R.drawable.wall_48;
- mThumbIds[1]= R.drawable.wall_48;
- mThumbIds[2]= R.drawable.wall_48;
- }
- if (r==1)
- {
- mThumbIds[3]= R.drawable.wall_48;
- mThumbIds[4]= R.drawable.wall_48;
- mThumbIds[5]= R.drawable.wall_48;
- }
- if (r==2)
- {
- mThumbIds[6]= R.drawable.wall_48;
- mThumbIds[7]= R.drawable.wall_48;
- mThumbIds[8]= R.drawable.wall_48;
- }
- if (r==3)
- {
- mThumbIds[9]= R.drawable.wall_48;
- mThumbIds[10]= R.drawable.wall_48;
- mThumbIds[11]= R.drawable.wall_48;
- }
- } //shuffle end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement