I'm making an app where an AlertDialog is needed. When the dialog opens, it looks like a Jellybean alert dialog, but when I paste the code in another project it looks like a Lollipop alert dialog. Why? (I'm making the dialog using AlertDialog.Builder solution; said in case another solution exists. Also, I'm programming with AIDE development environment and I have Lollipop OS installed on the device.)
Asked
Active
Viewed 63 times
0
-
1just change your application compile level. if compileSdkVersion 23 then it's working fine for all the version's of Android. – Hardy Android May 05 '16 at 10:27
3 Answers
0
if use AppCompact style
you can add this line to it
<item name="alertDialogTheme">@style/AppCompatAlertDialogStyle</item>
and in your code import android.support.v7.app.AlertDialog
AlertDialog.Builder builder =
new AlertDialog.Builder(this);

androidAhmed
- 227
- 1
- 4
- 16
0
setContentView property can use your custom layout
Dialog dialog = new Dialog(this);
dialog.setContentView(R.layout.custom_dialog_layout);

Masum
- 4,879
- 2
- 23
- 28