我在我的Android应用程序中使用片段,我的问题是我无法将列表视图中所选项目的内容发送到另一个片段。我使用了getItemAtPosition方法,但我无法使用它。继续。 这是第一个片段的代码:
lv.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener(){
@Override
public boolean onItemLongClick(AdapterView<?> arg0, View arg1, int position, long arg3) {
// TODO Auto-generated method stub
FragmentManager fragmentManager = getFragmentManager();
Fragment fragmentACharger = null;
Client c=(Client) lv.getItemAtPosition(position);
fragmentACharger = new Consulter_Client1();
fragmentManager.beginTransaction()
.replace(R.id.container,fragmentACharger).commit();
return false;
}
});
答案 0 :(得分:0)
lv.setOnItemLongClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
OnRestaurant_Click(position, );
}
});
答案 1 :(得分:0)
SELECT NAME,SALARY FROM CUSTOMERS GROUP BY NAME;