每日一问-Android-20181031为什么 HTTP Code 204 会导致 Retrofit 出现 NullPointerException?答:今天在做网络接口的时候, 一个返回结果应该是 Map 的接口出现了异常:java.lang.Nul...
阅读全文...
AlertDialog 为什么要先调用 show() 才能 getButton()?
在昨天的每日一问中, 我们有这么一行代码:private void showDialog() {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.s...
阅读全文...
阅读全文...
如何自定义 AlertDialog 的样式?
答: 通过设置 Theme 的 alertDialogTheme.1. 分析源码首先, 我们看下如何新建 AlertDialog, 通常代码如下:private void showDialog() {
AlertDialog.Builder bu...
阅读全文...
阅读全文...
如何在 BaseActivity 中封装 Toolbar ?
1. 设置 Theme在 style.xml 文件中建立如下主题:<resources>
<!-- Base application theme. -->
<style name="AppThem...
阅读全文...
阅读全文...