Advertisement
Guest User

Untitled

a guest
Apr 18th, 2014
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. public class ImageAdapter extends BaseAdapter {
  2. private Context mContext;
  3.  
  4.  
  5. public ImageAdapter(Context c) {
  6. // TODO Auto-generated constructor stub
  7. mContext = c;
  8. shuffle();
  9.  
  10. }
  11.  
  12. public void shuffle()
  13. {
  14.  
  15.  
  16. Random rand = new Random();
  17. int r = rand.nextInt(3);
  18. String rn;
  19. rn=String.valueOf(r);
  20. Log.d("Random Number Test", rn);
  21.  
  22. if (r==0)
  23. {
  24. mThumbIds[0]= R.drawable.wall_48;
  25. mThumbIds[1]= R.drawable.wall_48;
  26. mThumbIds[2]= R.drawable.wall_48;
  27. }
  28. if (r==1)
  29. {
  30. mThumbIds[3]= R.drawable.wall_48;
  31. mThumbIds[4]= R.drawable.wall_48;
  32. mThumbIds[5]= R.drawable.wall_48;
  33. }
  34. if (r==2)
  35. {
  36. mThumbIds[6]= R.drawable.wall_48;
  37. mThumbIds[7]= R.drawable.wall_48;
  38. mThumbIds[8]= R.drawable.wall_48;
  39. }
  40. if (r==3)
  41. {
  42. mThumbIds[9]= R.drawable.wall_48;
  43. mThumbIds[10]= R.drawable.wall_48;
  44. mThumbIds[11]= R.drawable.wall_48;
  45. }
  46. } //shuffle end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement