0
是否有可能只創建一個類併爲contentview使用一個變量?我正在考慮用大量帶有ID的按鈕來創建主佈局。一旦按下按鈕,它就會將ID傳遞給該類並使用該ID打開特定的佈局。一個班級,多個佈局。Android:是否有可能使ContentView動態化?
public class Main extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main); //is it possible to make 'main' a variable?
}
}
嗯(最小長度) – 2010-11-18 19:19:50
你有答案嗎? – Thomas 2010-11-20 13:22:23