this is the code
protected Void doInBackground(String... params) {
String reg_url = "http://10.0.2.2/";
String method = params [0];
if (method.equals("register") ){
String first_name = params [1];
String last_name = params [2];
String address = params [3];
String email = params [4];
String password = params [5];
try {
URL url = new URL(reg_url);
HttpURLConnection httpURLConnection = (HttpURLConnection)url.openConnection();
HttpURLConnection.setRequestMethod("POST");
HttpURLConnection.setDoOutput(True);
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
return null;
}
and i am getting the error on these two lines
HttpURLConnection.setRequestMethod("POST");
HttpURLConnection.setDoOutput(True);
on the set.RequestMethod("POST") and "setDoOutput(true); error says non static method cannot be referenced from a static context. it must be silly mistake but i just can't figure it out so can anybody help me with this please?