Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <pre><code>//CUSTOM SPINNER ADAPTER public class CardListAdapter extends ArrayAdapter&lt;Card&gt; { private Context appContext = null; private ArrayList&lt;Card&gt; items = null; public CardListAdapter(Context context, int textViewResourceId, ArrayList&lt;Card&gt; items) { super(context, textViewResourceId, items); this.appContext = context; this.items = items; } @Override public View getDropDownView(int position, View convertView, ViewGroup parent) { // TODO Auto-generated method stub return getCustomView(position, convertView, parent); } @Override public View getView(int position, View convertView, ViewGroup parent) { // TODO Auto-generated method stub View v = convertView; if (v == null) { LayoutInflater vi = (LayoutInflater) appContext .getSystemService(Context.LAYOUT_INFLATER_SERVICE); v = vi.inflate(R.layout.card_simple_list, null); } final Card o = items.get(position); if (o != null) { TextView name = (TextView) v.findViewById(R.id.card_Name); if (name != null) { name.setText(o.getName()); } } return v; } public View getCustomView(int position, View convertView, ViewGroup parent) { View v = convertView; if (v == null) { LayoutInflater vi = (LayoutInflater) appContext .getSystemService(Context.LAYOUT_INFLATER_SERVICE); v = vi.inflate(R.layout.card_list, null); } final Card o = items.get(position); if (o != null) { TextView name = (TextView) v.findViewById(R.id.card_Name); ImageButton btnDelete = (ImageButton) v .findViewById(R.id.card_Delete); btnDelete.setOnClickListener(new OnClickListener() { public void onClick(View view) { items.remove(o); notifyDataSetChanged(); } }); if (name != null) { name.setText(o.getName()); } } return v; } } // end custom adapter} </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. 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