我有一個抽屜導航:替換活動到碎片
private void DisplayView (int position) {
Fragment fragment = null;
switch (position) {
case 0:
fragment = new Fragment1();
break;
case 1:
fragment = new Fragment2();
break;
case 2:
...
從活動我可以拋出該片段(fragment2例如)?用BeginTransaction?
感謝
您需要了解的片段和活動之間的區別。 –
你不發送意圖片段 – tyczj
http://developer.android.com/reference/android/app/Fragment.html –