【发布时间】:2017-11-18 19:50:09
【问题描述】:
我需要将可绘制的 (mDLlist.get(position).getImageId()) 从 Fragment 传递到 DialogFragment。
我似乎无法找到如何做到这一点的方法,任何输入都会很棒。
谢谢你。
...
FragmentManager ft = ((FragmentActivity)context1).getSupportFragmentManager();
DialogFragment newFragment = MyNotification.newInstance();
Bundle args = new Bundle();
// How to pass this value ?
args.put?("appdraw", mDLlist.get(position).getImageId());
//--//
args.putString("appname", (String)mDLlist.get(position).getLabelnameText());
args.putString("appversion", mDLlist.get(position).getVersionName());
args.putString("appinstalltime", "Downloaded");
newFragment.setArguments(args);
newFragment.show(ft, "mydialog");
...
【问题讨论】:
-
getImageId())返回什么? -
可绘制。 public Drawable getImageId() { return imageId; } public void setImageId(Drawable imageId) { this.imageId = imageId; }
标签: android android-fragments bundle drawable