我通过共享偏好解决了我的需求。YuzdeDataUser 是我的自定义类,我从我的 Listview 中获取它 onClickItemListener
如何发送
YuzdeDataUser clickedObj = (YuzdeDataUser) parent.getItemAtPosition(position);
//clickedObj.setTarihim();
SharedPreferences shp = getSharedPreferences("sam", MODE_PRIVATE);
SharedPreferences.Editor editor = shp.edit();
Gson gson = new Gson();
String json = gson.toJson(clickedObj);
editor.putString("yoklamaList", json);
editor.commit();
FragmentManager fragmentManager = getSupportFragmentManager();
AylikRaporPop userPopUp = new AylikRaporPop();
userPopUp.show(fragmentManager, "sam");
如何接收
SharedPreferences shp = parent.getSharedPreferences("sam", MODE_PRIVATE);
SharedPreferences.Editor editor = shp.edit();
Gson gson = new Gson();
String json = shp.getString("yoklamaList", "");
YuzdeDataUser user = gson.fromJson(json, YuzdeDataUser.class);
if (user != null) {
txt_ad.setText(user.getAd());
txt_tur_tarih.setText(Util.getInstance(parent).writeNameOfTur(user.getTur_id()));
txt_var.setText("" + user.getVar());
txt_gorevli.setText("" + user.getGorevli());
txt_yok.setText("" + user.getYok());
}