Showing activity with custom dialog in Android
<p>I am developing an Android app. In my app, I want to show data in dialog. Basically, I want to show an <code>Activity</code> in dialog when a button is clicked. I know how to show <code>Activity</code> as dialog. Here is how I am currently showing activity as dialog.</p>

<p>I set <code>Activity</code> in <code>AndroidManifest</code> like this</p>

<pre><code>&lt;activity
    android:configChanges="orientation|screenSize"
    android:name=".MakeCommentActivity"
    android:label="Comment"
    android:theme="@android:style/Theme.Holo.Light.Dialog" &gt;
    &lt;intent-filter&gt;
        &lt;action android:name="android.intent.action.VIEW" /&gt;
        &lt;category android:name="android.intent.category.DEFAULT" /&gt;
    &lt;/intent-filter&gt;
&lt;/activity&gt;
</code></pre>

<p>So when I open activity. It show as dialog as below.</p>

<p><a href="https://i.stack.imgur.com/oWND5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oWND5.png" alt="enter image description here"></a></p>

<p>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.</p>

<p><a href="https://i.stack.imgur.com/58HML.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/58HML.png" alt="enter image description here"></a></p>

<p>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.</p>

<p>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. </p>

<p>So my question is how can I open an <code>Activity</code> 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.</p>