圖片資源:
private int fore[];
private int back[];
fore = new int[]{R.drawable.a0, R.drawable.a1, R.drawable.a2,
R.drawable.a3, R.drawable.a4, R.drawable.a5,
R.drawable.a6, R.drawable.a7, R.drawable.a8,
R.drawable.a9, R.drawable.a910, R.drawable.a911,
R.drawable.a912, R.drawable.a913, R.drawable.a914};
back = new int[]{R.drawable.b0, R.drawable.b1, R.drawable.b2,
R.drawable.b3, R.drawable.b4, R.drawable.b5,
R.drawable.b6, R.drawable.b7, R.drawable.b8,
R.drawable.b9, R.drawable.b910, R.drawable.b911,
R.drawable.b912, R.drawable.b913, R.drawable.b914};
//用戶保存加載的圖片
private List bitmapResource = new ArrayList();
GridView grid;//聲明 圖片顯示 類似九宮格 的 控件
Handler handler; //聲明 Handler 用來傳遞消息
計算方法:
int width = (int) (getWindowManager().getDefaultDisplay().getWidth()/density);//取得屏幕的寬度
ImageResource ir = new ImageResource();
//使用getPicture()方法 加載圖片
public void getPicture(){
new AsyncTask