I'm trying to connect my android app to PHP page.. this is AsyncTask class function:
@Override
protected String doInBackground(String... params) {
try {
accountDetails.add(new BasicNameValuePair("Name",params[0]));
JSONObject json = jparser.makeHttpRequest("http://site.page.php","POST",accountDetails);
/*My Problem is here..*/
String registerReport = json.getString("registerReport");
} catch (Exception e) {
error = e.toString();
}
return null;
}
and my php page return this:
{"registerReport":"1"}
And then i got this error: java.lang.NullPointerException: Attemp to invoke virtual method 'java.lang.Stringorg.json.JSONObject.getString(java.lang.String)' on a null object reference