appcompatdialog

How to Build AppCompatDialog From AlertDialog.Builder or Equivalent?

非 Y 不嫁゛ 提交于 2019-12-04 18:10:56
问题 Before this I used a DialogBuilder to create AlertDialog like this AlertDialog.Builder builder = new AlertDialog.Builder(context); ... ... AlertDialog dialog = builder.create(); How can I build the new AppCompatDialog from a dialog builder, or is there another new equivalent way to do that? 回答1: Just found the solution. I should import import android.support.v7.app.AlertDialog; and then AppCompatDialog dialog = builder.create() will work. 回答2: If you would like to use an AlertDialog , just

How to Build AppCompatDialog From AlertDialog.Builder or Equivalent?

帅比萌擦擦* 提交于 2019-12-03 11:26:28
Before this I used a DialogBuilder to create AlertDialog like this AlertDialog.Builder builder = new AlertDialog.Builder(context); ... ... AlertDialog dialog = builder.create(); How can I build the new AppCompatDialog from a dialog builder, or is there another new equivalent way to do that? Just found the solution. I should import import android.support.v7.app.AlertDialog; and then AppCompatDialog dialog = builder.create() will work. If you would like to use an AlertDialog , just import the new supprt v 22.1 and use a code like this (pay attention to the import): import android.support.v7.app