我有一個代碼,它將從庫中獲取圖像,然後使用它設置gridSize。從startActivityForResult獲取結果
將把android發送到SizeSelection類的主要代碼。
PuzzleAcitivity:
if(resultCode == RESULT_OK) {
Intent gridSizeIntent = new Intent();
gridSizeIntent.setClass(this, SizeSelection.class);
startActivityForResult(gridSizeIntent, GRIDSIZE_VALUE_SELECT);
createGameBoard(SizeSelection.getGridSize(this));
}
但是這是在麻煩踢:SizeSelection,當我打的應該激活並設置gridSize沒有happends的按鈕。我認爲問題在於將數據從SizeSelection獲取到PuzzleActivity主類。
sizeSelection:
protected static short getGridSize(Context content) {
if (mIbtn3x3 == view) {
short gridSize = 3;
return gridSize;
}else if (mIbtn4x4 == view) {
short gridSize = 4;
return gridSize;
}else if (mIbtn5x5 == view) {
short gridSize = 5;
return gridSize ;
}
return gridSize;
}
我怎麼完成getGridSize方法?在此先感謝