Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Instead of using <code>new AdapterView.OnItemClickListener()</code>, You can use the <code>new OnItemClickListener()</code> which imports <code>import android.widget.AdapterView.OnItemClickListener;</code></p> <p><strong>Dont have the click listener for the inflated layout and also for the parent layout(ie for listview). If you have the inflated layout's click listener then control will directly transfer there.</strong></p> <pre><code>myListViewmyListView.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int position, long arg3) { price = (EditText)findViewById(R.id.price); double price1 = Double.parseDouble(price.getText().toString()); double total = price1 *1.1; String resultPrice = Double.toString(total); result.setText(resultPrice); } }); </code></pre> <p>I think this might give you some idea. And once the data has changed try to call the <code>notifyDataSetChanged()</code> method to refresh the view.</p> <p>All the best.</p> <pre><code>class FancyAdapter extends BaseAdapter { Button calculate; EditText price; EditText result; @Override public int getCount() { return noteList.length; } @Override public Object getItem(int arg0) { return null; } @Override public long getItemId(int position) { return 0; } @Override public View getView(int position, View convertView, ViewGroup parent) { View row = convertView; if(row == null) { LayoutInflater inflater = getLayoutInflater(); row = inflater.inflate(R.layout.custom_list_item, null); } return (row); } } </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