我想保持相同的活动(这是一个标签式活动,但我只想更改我按下列表项时的标签片段 所以我该怎么做 ? 请帮忙
public class PrayersAdvantagesFragment扩展了ListFragment {
private String[] data;
private ArrayList<String[]> a7adith;
private StringsListAdapter stringsListAdapter;
private AlertDialog categoryDialogObject;
int i;
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
a7adith = new ArrayList<String[]>();
Intent intent = getActivity().getIntent();
data = intent.getStringArrayExtra(MainActivity.A7ADITH);
for (i = 0; i < data.length; i++) {
a7adith.add(new String[]{data[i],data[i+1]});
i++;
}
stringsListAdapter = new StringsListAdapter(getActivity(), a7adith);
setListAdapter(stringsListAdapter);
//registerForContextMenu(getListView());
}
@Override
public void onListItemClick(ListView l, View v, int position, long id) {
super.onListItemClick(l, v, position, id);
String[] string = (String[]) getListAdapter().getItem(position);
BuildCategoryDialog(string);
categoryDialogObject.show();
}
答案 0 :(得分:0)
我认为你应该设置事件来改变StringListAdapter的 getView 方法中的片段。 希望这能帮助你。