常用的方法是:在Activity中将要传递的数据封装在一个Bundle对象中,使用setArgument(Bundel bundle)方法传递数据,在要传递到的Fragment中使用this.getArgment()得到传递到的Bundle。
Android中Activity如何向Fragment传递数据
最新推荐文章于 2023-03-15 21:07:41 发布
常用的方法是:在Activity中将要传递的数据封装在一个Bundle对象中,使用setArgument(Bundel bundle)方法传递数据,在要传递到的Fragment中使用this.getArgment()得到传递到的Bundle。