Android Get data from server to android issue
<p>I want to get data from server and save it in the listview I have write right code there is no error but when I click on activity app stopped here is my activity code/</p>

<pre><code>    public class UserListActivity extends ActionBarActivity {

    String myJSON;

    private static final String TAG_RESULTS="result";
   // private static final String TAG_ID = "id";
    private static final String TAG_NAME = "name";
    private static final String TAG_EMAIL ="email";

    JSONArray peoples = null;

    ArrayList&lt;HashMap&lt;String, String&gt;&gt; personList;

    ListView list;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_user_list);
        list = (ListView) findViewById(R.id.listView);
        personList = new ArrayList&lt;HashMap&lt;String,String&gt;&gt;();
        getData();
    }


    protected void showList(){
        try {
            JSONObject jsonObj = new JSONObject(myJSON);
            peoples = jsonObj.getJSONArray(TAG_RESULTS);

            for(int i=0;i&lt;peoples.length();i++){
                JSONObject c = peoples.getJSONObject(i);
                //String id = c.getString(TAG_ID);
                String name = c.getString(TAG_NAME);
                String email = c.getString(TAG_EMAIL);

                HashMap&lt;String,String&gt; users = new HashMap&lt;String,String&gt;();

     //           persons.put(TAG_ID,id);
                users.put(TAG_NAME,name);
                users.put(TAG_EMAIL,email);

                personList.add(users);
            }

            ListAdapter adapter = new SimpleAdapter(
                    UserListActivity.this, personList, R.layout.list_item,
                    new String[]{TAG_NAME,TAG_EMAIL},
                    new int[]{R.id.name, R.id.email}
            );

            list.setAdapter(adapter);

        } catch (JSONException e) {
            e.printStackTrace();
        }

    }

    public void getData(){
        class GetDataJSON extends AsyncTask&lt;String, Void, String&gt;{

            @Override
            protected String doInBackground(String... params) {
                DefaultHttpClient httpclient = new DefaultHttpClient(new BasicHttpParams());
                HttpPost httppost = new HttpPost("http://samplechatapp.gear.host/Get-Data.php");

                // Depends on your web service
                httppost.setHeader("Content-type", "application/json");

                InputStream inputStream = null;
                String result = null;
                try {
                    HttpResponse response = httpclient.execute(httppost);
                    HttpEntity entity = response.getEntity();

                    inputStream = entity.getContent();
                    // json is UTF-8 by default
                    BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, "UTF-8"), 8);
                    StringBuilder sb = new StringBuilder();

                    String line = null;
                    while ((line = reader.readLine()) != null)
                    {
                        sb.append(line + "\n");
                    }
                    result = sb.toString();
                } catch (Exception e) {
                    // Oops
                }
                finally {
                    try{if(inputStream != null)inputStream.close();}catch(Exception squish){}
                }
                return result;
            }

            @Override
            protected void onPostExecute(String result){
                myJSON=result;
                showList();
            }
        }
        GetDataJSON g = new GetDataJSON();
        g.execute();
    }
}
</code></pre>

<p>This is log cat message:</p>

<p><a href="https://i.stack.imgur.com/CcO1T.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CcO1T.png" alt="log cat message image"></a></p>

<p><br></p>

<p>This is the data on the server which I want to get.</p>

<p><a href="https://i.stack.imgur.com/nL87h.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nL87h.png" alt="Data on the server image"></a></p>