如何使用Eclipse和Android SDK在主详细信息模板中的ItemListActivity.java文件中使用以下代码。 由于此页面代码最初有一个oncreate包代码,后来它有一个用于两个窗格代码....
final String[] data ={"one","two","three"};
final String[] fragments ={
"org.arthakrantipratishthan.arthakranti.CommunityFragment",
"org.arthakrantipratishthan.arthakranti.PagesFragment",
"org.arthakrantipratishthan.arthakranti.HomeFragment"};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_item_list);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(getActionBar().getThemedContext(), android.R.layout.simple_list_item_1, data);
final DrawerLayout drawer = (DrawerLayout)findViewById(R.id.drawer_layout);
final ListView navList = (ListView) findViewById(R.id.drawer_layout);
navList.setAdapter(adapter);
}