之前使用v7包下的AlertDialog报错:
you need to use a Theme.AppCompat theme (or descendant) with this activity.
说是主题不兼容,照着网上的方法改了 增加了theme还是报相同的错
然后直接改为导入android.app.AlertDialog然后报错:
Unable to add window -- token null is not for an application
后来才知道是传入的contex错误 不能用application的context 于是改为activity.this 成功解决