I am developing an Android app. In my app, I want to show data in dialog. Basically, I want to show an Activity
in dialog when a button is clicked. I know how to show Activity
as dialog. Here is how I am currently showing activity as dialog.
I set Activity
in AndroidManifest
like this
<activity
android:configChanges="orientation|screenSize"
android:name=".MakeCommentActivity"
android:label="Comment"
android:theme="@android:style/Theme.Holo.Light.Dialog" >
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
So when I open activity. It show as dialog as below.
As you can see in screenshot, the problem with above code is I cannot fully control over design. I mean I cannot set the background color of dialog as I want. I will change depending on the device. I cannot change the theme of dialog. Besides, I cannot remove the title of dialog and so on.
Like in above screenshot, I will have fully control over design. I can add icon in title. I can set whatever theme I want and so on.
So what I can think is to use an alert dialog with custom view. But if I do it, code will not be clean and neat because all the logic and code will be places in the parent activity. Not in different Activity.
So my question is how can I open an Activity
as dialog that can be fully customized in design? If cannot fully customized, using alert dialog with custom view is a good idea? Because I will show comments like in Facebook. User can make comment as well.