Skip to main content

Posts

Showing posts with the label alertdialog

Android Custom Alert Dialog Display Error after changing the Build Version

I am developing one simple demo . Here in this demo i just create one simple custom alert dialog . Its work fine. It shows me the perfect result when i build application in 1.6, but when i change the android version from 1.6 to 2.2 its shows the unexpected result. It doesn't show the background screen on which i display the custom alert dialog. Here is my xml file. Custom Dialog Theme File <?xml version="1.0" encoding="utf-8"?> <resources> <style name="CustomDialogTheme" parent="@android:style/AlertDialog"> <item name="android:windowFrame">@null</item> <item name="android:windowContentOverlay">@null</item> <item name="android:backgroundDimEnabled">true</item> <item name="android:windowIsTranslucent">true</item> <item name="android:windowNoTitle">true</item> &

XML layout overlapping AlertDialog"s Title

I am developing an Android application where the user is asked to "setup" before recording data. This is accomplished using an AlertDialog that inflates an XML layout, using such code: final AlertDialog.Builder builder = new AlertDialog.Builder(this); LayoutInflater vi = (LayoutInflater)this.getSystemService(Context.LAYOUT_INFLATER_SERVICE); View v = vi.inflate(R.layout.setup, null); builder.setView(v); On an emulator or a 2.3.3 device, it looks fine: However, the title that reads "Configure Options" is overlapped on a 2.1.1 device (which has a smaller screen). It looks more or less like this: Does anyone know what the potential problem may be? The XML layout is scroll enabled so that if it doesn't fit in the dialog, the user can scroll (which works fine in the emulator and 2.3.3, but not 2.1.1). Perhaps there is some way to make the AlertDialog fit the whole screen using Java code? Thank you for the help. EDIT: setup.xml (with names of some thi