Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Use below xml layout for custom dialog that you want to display,</p> <blockquote> <p></p> <pre><code>&lt;FrameLayout android:layout_width="fill_parent" android:layout_height="fill_parent" &gt; &lt;ListView android:id="@+id/gameList" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginBottom="30dip" /&gt; &lt;LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_gravity="bottom" &gt; &lt;Button android:id="@+id/load" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1" android:text="Load" /&gt; &lt;Button android:id="@+id/delete" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1" android:text="Delete" /&gt; &lt;/LinearLayout&gt; &lt;/FrameLayout&gt; </code></pre> <p></p> </blockquote> <p>And call it like this from your class file,</p> <pre><code>&gt; Button getList = (Button) findViewById(R.id.getList); &gt; getList.setOnClickListener(new View.OnClickListener() { &gt; &gt; @Override &gt; public void onClick(View v) { &gt; // TODO Auto-generated method stub &gt; final Dialog listDialog = new Dialog(MainActivity.this); &gt; listDialog.setTitle("Load a game"); &gt; listDialog.setContentView(R.layout.custom_dialog); &gt; &gt; ListView gameList = (ListView) listDialog.findViewById(R.id.gameList); &gt; gameList.setAdapter(new ArrayAdapter&lt;String&gt; (MainActivity.this,android.R.layout.simple_list_item_1,new String[] {"your array" })); &gt; &gt; Button dismiss = (Button) listDialog.findViewById(R.id.load); &gt; dismiss.setOnClickListener(new View.OnClickListener() { &gt; &gt; @Override &gt; public void onClick(View v) { &gt; // TODO Auto-generated method stub &gt; listDialog.dismiss(); &gt; } &gt; }); &gt; &gt; listDialog.show(); &gt; &gt; } }); </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. 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.
 

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