Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>For using action bar in Dialog, you have to create a custom theme in your style.xml with parent as "Theme.AppCompat.Light".</p> <pre><code>&lt;style name="PopupTheme" parent="Theme.AppCompat.Light"&gt; &lt;item name="android:windowFrame"&gt;@null&lt;/item&gt; &lt;item name="android:windowIsFloating"&gt;false&lt;/item&gt; &lt;item name="android:windowContentOverlay"&gt;@null&lt;/item&gt; &lt;item name="android:windowAnimationStyle"&gt;@android:style/Animation.Dialog&lt;/item&gt; &lt;item name="android:windowSoftInputMode"&gt;stateAlwaysHidden&lt;/item&gt; &lt;item name="android:windowActionModeOverlay"&gt;true&lt;/item&gt; &lt;item name="android:colorBackgroundCacheHint"&gt;@null&lt;/item&gt; &lt;item name="android:windowCloseOnTouchOutside"&gt;true&lt;/item&gt; &lt;item name="android:windowIsTranslucent"&gt;true&lt;/item&gt; &lt;/style&gt; </code></pre> <p>And add this style in your manifest with activity tag:</p> <pre><code>&lt;activity android:name=".MyActivity" android:configChanges="orientation|keyboardHidden|locale" android:screenOrientation="portrait" android:theme="@style/PopupTheme" &gt; </code></pre> <p>and last add this code in your activity before <code>setConytentView(layoutID)</code>;</p> <pre><code>@Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); this.requestWindowFeature(Window.FEATURE_ACTION_BAR); this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND, WindowManager.LayoutParams.FLAG_DIM_BEHIND); LayoutParams params = this.getWindow().getAttributes(); params.alpha = 1.0f; params.dimAmount = 0.5f; this.getWindow().setAttributes((android.view.WindowManager.LayoutParams) params); // This sets the window size, while working around the IllegalStateException thrown by ActionBarView this.getWindow().setLayout(600,900); setContentView(R.layout.dialog_move); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload