Question

For clarification: I want all the custom dialogs to look like system default dialogs: for example, when user is using htc sense, the dialog should match htc sense dialog style, when user is using samsung with official customasation, the dialog should look like it. I want to go as native as possible. I am familiar that there are possibilities to modify the dialog, but I'm looking for a way to reference to the style the system uses and create a dialog with that.

What I have:

enter image description here

What I would like to achieve:

enter image description here

Code for my dialog layout which I invoke with dialog.setContentView(...):

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
style="@android:style/Theme.Dialog"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >

<ListView
    android:id="@+id/listView1"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_marginLeft="10dip"
    android:layout_marginRight="10dip" >
</ListView>

</LinearLayout>

As you can see setting the style="@android:style/Theme.Dialog isn't helping. Any ideas what might be helping?

(I am familiar that there is already such a question: https://stackoverflow.com/questions/6746535/android-custom-dialog-but-with-look-and-feel-of-default-one but there isn't an accepted answer)

Was it helpful?

Solution 2

You can build a native-look like dialog for one UI, but when another user has some other ROM/modified UI, then the dialog doesn't look like a native one to hem/her. There isn't a built in functionality, to access system dialog resources and populate all dialogs from native layouts only.

OTHER TIPS

If you want the dialog that appear just for your application purpose then follow this:

See this image i have create this one to save Image or Post it to different way.

enter image description here

I have created the xml layout as per my requirement. If you want to add the list view as you have explained in to the question then you have to manualy implement that behaviour in the content of the dialog. Means for such layour You have to implement the Custom ListView that have that radio button and text. And also have some Java code to do action according to that selection.

With that you can acheive as you want.

Enjoy. :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top