上一页 1 ··· 30 31 32 33 34 35 36 37 38 ··· 49 下一页
摘要: 调用 dialog.show(getSupportFragmentManager(), "tag");时出现了java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState的错误。报错的原因:dialog.show()方法的内部使用了commit()方法提交事务,某些时候因为状态异常而报... 阅读全文
posted @ 2019-02-19 19:25 yongfengnice 阅读(7586) 评论(0) 推荐(0)
摘要: private List mPathList; private FragmentStatePagerAdapter mPagerAdapter; //1.使用FragmentStatePagerAdapter mPagerAdapter = new FragmentStatePagerAdapter(getSupportFragmentManager()) { @Override ... 阅读全文
posted @ 2019-02-19 11:09 yongfengnice 阅读(1208) 评论(0) 推荐(0)
摘要: //activity_main.xml 添加layout根布局,添加bind域名空间 ... //bind的作用:将主页的listener变量的值传递给include页的onClick变量 //main_include.xml 阅读全文
posted @ 2019-02-15 19:16 yongfengnice 阅读(1877) 评论(0) 推荐(0)
摘要: @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { getDialog().getWindow().setBackgroundDrawable(... 阅读全文
posted @ 2019-02-11 18:33 yongfengnice 阅读(2808) 评论(0) 推荐(0)
摘要: //java代码: public class CountrySelectDialog extends AppCompatDialogFragment{ public static CountrySelectDialog newInstance() { Bundle args = new Bundle(); CountrySelectDialog fragment = new... 阅读全文
posted @ 2019-01-31 14:33 yongfengnice 阅读(719) 评论(0) 推荐(0)
摘要: 使用AppCompatDialogFragment 或者 DialogFragment 的过程中遇到java.lang.IllegalStateException: Fragment already added: 的解决方法: 阅读全文
posted @ 2019-01-31 14:17 yongfengnice 阅读(8617) 评论(0) 推荐(1)
摘要: Android双向数据绑定DataBinding没有自动生成setXXX的方法的原因可能如下: 1.布局文件需要以 <layout></layout> 标签作为根标签,DataBind才能自动生成对应的方法 2.布局文件不能有语法错误,否则编译都不过肯定不会生成的 3. mBinding成员变量不要 阅读全文
posted @ 2019-01-25 15:53 yongfengnice 阅读(903) 评论(0) 推荐(0)
摘要: private void setToolBarCenterTitle() { TextView titleTv = new TextView(this); titleTv.setTextColor(ContextCompat.getColor(this, R.color.black)); title 阅读全文
posted @ 2019-01-25 15:38 yongfengnice 阅读(1590) 评论(0) 推荐(0)
摘要: 如果项目构建时遇到了 Task 'assembleXXXDebug' not found in project ':app'.的问题,原因可能如下: 项目gradle配置文件里面设置了 productFlavors,比如改为了YYY,然后对应的debug的assemble应该是assembleYYY 阅读全文
posted @ 2019-01-25 11:44 yongfengnice 阅读(16677) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2019-01-13 23:59 yongfengnice 阅读(239) 评论(0) 推荐(0)
上一页 1 ··· 30 31 32 33 34 35 36 37 38 ··· 49 下一页