嗨,我正在玩 korovyansk 滑出示例应用程序,我是 Fragment 的新手,有人能告诉我如何从另一个 Fragment 调用活动。当列表项单击它应该触发另一个活动
public class MenuFragment extends ListFragment {
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
setListAdapter(new ArrayAdapter<String>(getActivity(),
android.R.layout.simple_list_item_1, new String[] { " First", " Second", " Third", " Fourth", " Fifth", " Sixth"}));
getListView().setCacheColorHint(0);
}
@Override
public void onListItemClick(ListView l, View v, int position, long id) {
super.onListItemClick(l, v, position, id);
((MenuActivity)getActivity()).getSlideoutHelper().close();
}
}