You need to use a Theme.AppCompat theme (or descendant) with this activity. Change to Theme.AppCompat causes other error

前端 未结 14 954
Happy的楠姐
Happy的楠姐 2020-11-27 15:47

I use appcompat v22.1.0 in my App and use Toolbar. Everything was fine when I use Theme.AppCompat.Light.NoActionBar. When I start implement AlertDialog

14条回答
  •  长情又很酷
    2020-11-27 16:36

    The probem is because of Context which You are passing to build the Alert Dialog.Don't Use getApplicationContext().Try using your Activity context.Use AlertDialog.Builder builder = new AlertDialog.Builder(MainActiviy.this);

提交回复
热议问题