解决方法:自定义的fragment最好有一个Public的参数为空的构造函数,若需要传入一个参数,可以使用下面的方法public FileViewFragment(){ } public static FileViewFragment getInstance(A a){ FileViewFragment fileViewFragment = new FileViewFragment(); fileViewFragment.a = a; return fileViewFragment; }
本文共 273 字,大约阅读时间需要 1 分钟。
解决方法:自定义的fragment最好有一个Public的参数为空的构造函数,若需要传入一个参数,可以使用下面的方法public FileViewFragment(){ } public static FileViewFragment getInstance(A a){ FileViewFragment fileViewFragment = new FileViewFragment(); fileViewFragment.a = a; return fileViewFragment; }
转载地址:http://uhyql.baihongyu.com/