I want to create a custom dialog box like below
I have tried the following things.
I created a subclass of AlertDialog.Builder and used a custom Title and Custom Content View and used that but the result was not as expected.
Another attempt was to subclass DialogFragment and customize the dialog inside onCreateDialog that but result was not as expected.
Then I tried using a plain Dialog class. The result was not as expected.
In all three cases, the problem is when I overlook the title view the size of the dialog is not as expected and when I use Title view the result is there is a thick border around the content view (which really looks bad). Now I have two questions in my mind…
How can I achieve that? As I have already tried so many things, a direct answer will be more appreciated.
What is the best way to show an error or alert dialog in an android app?
Android Developer Documentation recommends that we should use either DialogFragments or Dialogs for showing Error / Alert Messages to the user. However at one point they say …
Tip: If you want a custom dialog, you can instead display an Activity as a dialog instead of using the Dialog APIs. Simply create an activity and set its theme to Theme.Holo.Dialog in the manifest element.
What is the meaning of that? Isn't it too much to use an Activity just for showing an error message???