Android Alert Dialog help to customize for API >=8 -
hiee guys, need create alertdialog :
for api >=8.
please allow me know how go it. , possible create android versions>=8
help appreciated. give thanks you.
here how can want using dialog
.
dialog dialog = new dialog(fingerpaintactivity.this, android.r.style.theme_light_panel); dialog.requestwindowfeature(window.feature_no_title); // no title dialog.getwindow().getattributes().windowanimations = r.style.pausedialoganimation; // used custom animation when dialog showing , hiding dialog.setcontentview(getlayoutinflater().inflate(r.layout.mycustomlayout, null)); // here custom layout dialog.getwindow().setlayout(width-50, (height-100)); // set height / width dialog.show();
the layout have add together r.layout.mycustomlayout
, after can views declared in layout shown below (for illustration button):
button myokbtn = (button) dialog.findviewbyid(r.id.myokbtn); myokbtn.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { } });
and that's all.
p.s. can see have things added custom animations while dialog opening , closed , width , height.
android api android-alertdialog
No comments:
Post a Comment