Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Check this code for Dynamic tablelayout :</p> <p>main.xml :</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#C0C0C0"&gt; &lt;RelativeLayout android:layout_width="fill_parent" android:paddingBottom="20dip" android:layout_height="fill_parent" android:background="#C0C0C0"&gt; &lt;TableLayout android:id="@+id/contact_table" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@+id/contact_info_title" android:layout_marginTop="10dp" android:background="@drawable/bgwhite_selector"&gt; &lt;/TableLayout&gt; &lt;/RelativeLayout&gt; &lt;/ScrollView&gt; </code></pre> <p>To add Contents of TableLayout use this xml file :</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/lays" android:layout_width="wrap_content" android:background="@color/white" android:layout_height="wrap_content" android:orientation="vertical"&gt; &lt;TableRow android:background="@color/white" android:layout_width="wrap_content" android:layout_height="wrap_content"&gt; &lt;TextView android:text="&gt;" android:textSize="18dip" android:textStyle="bold" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/arrowText"/&gt; &lt;/TableRow&gt; &lt;/LinearLayout&gt; </code></pre> <p>After you created sepearate rows for layouts add this in Java code :</p> <pre><code>contact_table = (TableLayout)findViewById(R.id.contact_table); LayoutInflater inflater = getLayoutInflater(); for(int i = 0; i &lt; contact_count ; i++) { LinearLayout row = (LinearLayout)inflater.inflate(R.layout.table_row,contact_table, false); TextView text = (TextView)row.findViewById(R.id.text); text.setText(list_data.get(i).summary); contact_table.addView(row); } for(int i=0;i&lt;contact_table.getChildCount();i++){ final View row=contact_table.getChildAt(i); row.setOnClickListener(new OnClickListener(){ @Override public void onClick(View v){ // TODO Auto-generated method stub row_id=contact_table.indexOfChild(row); } }); } </code></pre> <p>Second for is the loop getting the click of Dynamically created Table row , in that add the </p> <pre><code> msg_title_text.setOnEditorActionListener(new DoneOnEditorActionListener()); </code></pre> <p>Corresponding Action listener :</p> <pre><code> class DoneOnEditorActionListener implements OnEditorActionListener { @Override public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { if (actionId == EditorInfo.IME_ACTION_DONE) { Log.v("*****************************", "Clicked"); return true; } return false; } } </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.
    3. 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