android user requesting friends list gets a null
<p>Im getting a null point exception when i runs this code.</p>

<p>what i tried to do is... get the useremail from the application to the string uemail and tried to fetch the friends who are friends with uemail.</p>

<p>activity</p>

<pre><code>public class MainActivity extends Activity {
    protected static final String TAG_Name = null;
    int a;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        a = 2;
        Button ref = (Button)findViewById(R.id.button1);

        ref.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View arg0) {
                // TODO Auto-generated method stub

                InputStream is = null;
                String result = "";

                ArrayList&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;();

                String uemail = String.valueOf(a);
                nameValuePairs.add(new BasicNameValuePair("place_id", uemail));
                try {
                    HttpClient httpclient = new DefaultHttpClient();
                    HttpPost httppost = new HttpPost(
                            "http://www.hopscriber.com/test.php");
                    httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
                    HttpResponse response = httpclient.execute(httppost);
                    HttpEntity entity = response.getEntity();
                    is = entity.getContent();
                } catch (Exception e) {
                    Log.e("log_tag", "Error in http connection" + e.toString());
                }
                // convert response to stringtry
                try {
                    BufferedReader reader = new BufferedReader(new InputStreamReader(
                            is, "iso-8859-1"), 8);
                    StringBuilder sb = new StringBuilder();
                    String line = null;
                    while ((line = reader.readLine()) != null) {
                        sb.append(line + "\n");
                    }
                    is.close();

                    result = sb.toString();
                } catch (Exception e) {
                    Log.e("log_tag", "Error converting result " + e.toString());
                }
                try {
                    ArrayList&lt;HashMap&lt;String, String&gt;&gt; contactList = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();

                    JSONArray jsonArray = new JSONArray(result);

                    if (jsonArray != null) {
                        for (int i = 0; i &lt; jsonArray.length(); i++) {
                            JSONObject object = (JSONObject) jsonArray.get(i);

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

                            map.put(TAG_Name, object.getString("place_id"));

                            contactList.add(map);

                        }
                    }
                    TextView z = (TextView)findViewById(R.id.textView1);

                    z.setText(TAG_Name);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        });
</code></pre>

<p>php</p>

<pre><code>&lt;?php
include "db_config.php";

$q=mysql_query("SELECT 'name' FROM places WHERE place_id='".$_REQUEST['place_id']."'");

while($e=mysql_fetch_assoc($q))
        $output[]=$e;

print(json_encode($output));

mysql_close();
?&gt;
</code></pre>

<p>i seems can't find the answer.... please help me out.. it tigers null </p>
