Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Have you tried using a relative layout? Then you can add the following to your edit text in xml: android:layout_below="@+id/your_listview_id"</p> <p><strong>EDIT</strong></p> <p>The adapter</p> <pre><code>public class ListAdapter extends BaseAdapter{ List&lt;String&gt; itemList = new ArrayList&lt;String&gt;(); Context context; void addItem(String item){ itemList.add(item); } public ListAdapter(Context context){ this.context = context; } @Override public int getCount() { // TODO Auto-generated method stub return itemList.size(); } @Override public Object getItem(int arg0) { // TODO Auto-generated method stub return null; } @Override public long getItemId(int arg0) { // TODO Auto-generated method stub return 0; } @Override public View getView(int position, View arg1, ViewGroup arg2) { // TODO Auto-generated method stub View list; LayoutInflater inflater = getLayoutInflater(); list = inflater.inflate(R.layout.list_item, null); TextView text = (TextView) list.findViewById(R.id.text_view); text.setText(itemList.get(position)); if (itemList.get(position).toString().trim().equals("edit")){ // Add a Edit text dynamically text.setText("Edit text here"); } return list; } } </code></pre> <p>The onCreate()</p> <pre><code>@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_uga); ListView list = (ListView) findViewById(R.id.list_view); List&lt;String&gt; list_content = new ArrayList&lt;String&gt;(); listAdapter = new ListAdapter(getApplicationContext()); list_content.add("1"); list_content.add("2"); list_content.add("3"); list_content.add("4"); list_content.add("5"); list_content.add("6"); list_content.add("7"); list_content.add("8"); list_content.add("9"); list_content.add("10"); list_content.add("edit"); list.setAdapter(listAdapter); for (String text : list_content){ listAdapter.addItem(text); } } </code></pre>
 

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