Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>You have to create ListView adapter:</strong></p> <p>Put this in your Code :</p> <pre><code>private String[] listArr; public ArrayList&lt;String&gt; ary_name = new ArrayList&lt;String&gt;(); try { HttpResponse response = httpclient.execute(httppost); String jsonResult = inputStreamToString(response.getEntity().getContent()).toString(); JSONArray mArray = new JSONArray(jsonResult); for (int i = 0; i &lt; mArray.length(); i++) { JSONObject object = mArray.getJSONObject(i); String name = object.getString("name"); String password = object.getString("password"); textView.setText(name + " - " + password); ary_name.add(name); } listArr = new String[ary_name.size()]; listArr = ary_name.toArray(listArr); MyArrayAdapter adapter = new MyArrayAdapter(this, listArr); listView.setAdapter(adapter); public class MyArrayAdapter extends ArrayAdapter&lt;String&gt; { Activity context; String[] listArr; private TextView btnchkout; // private final integer[] image; public MyArrayAdapter(Activity context, String[] objects) { super(context, R.layout.custmlayout, objects); // TODO Auto-generated constructor stub this.context = context; listArr = objects; } @Override public View getView(final int position, View convertView, ViewGroup parent) { // TODO Auto-generated method stub LayoutInflater inflater = (LayoutInflater) getSystemService(Activity.LAYOUT_INFLATER_SERVICE); View view = inflater.inflate(R.layout.custmlayout, null, true); TextView textView = (TextView) view.findViewById(R.id.txtTicketNo); textView.setText(listArr[position]); return view; } } </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.
 

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