最初,我有 2 个活动。A叫B活动。现在我更改了 A 类扩展 SherlockFragmentActivity 和 B 类扩展 SherlockFragment。
我试图在 A 类中更改这些:
private class MyTabListener implements ActionBar.TabListener {
@Override
public void onTabSelected(Tab tab, FragmentTransaction ft) {
if (tab.getPosition()==1) {
B frag = new B();
ft.replace(android.R.id.content, frag);
}
}
@Override
public void onTabUnselected(Tab tab, FragmentTransaction ft) {
// TODO Auto-generated method stub
}
@Override
public void onTabReselected(Tab tab, FragmentTransaction ft) {
// TODO Auto-generated method stub
}
}
//==============================
B类:
public class Br extends SherlockFragment{
/* Called when the activity is first created */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.promotionslist_tableview);
//get our listview
ListView myListView = (ListView) findViewById(R.id.myListView_promotionslist_table);
//================================
但是错误。1. onCreate 2. findViewById..
我错了什么?
请给我一些提示。谢谢。