Android: open new Activity as Dialog

Did you ever have the problem that your pop-up dialog was so complex that it messed its parent's activity's code? There is a very simple solution to that. Just create the whole thing as a new activity class and change them theme to Theme.Dialog in your AndroidManifest.xml for that specific activity:
And the result should looking similar to this:

That's a really quick & dirty hack. However, the most important thing I learned out of this "accident" is, that I now know how I can easily customize the basic look of my activity screens, just by changing the android:theme attribute in the activity element of the AndroidManifest.xml.

1 comment:

  1. Thanks alot for sharing, i think you may find other helpful things here ( http://d.android.com/guide/topics/ui/themes.html ).

    ReplyDelete