I have provided onCreate() and New password method where on debugging, it is crashing on getResponsecode(). It is crashing and not getting response. It is not going to get response from server.
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.change_password_activity);
list(getIntent().getExtras().getString("JSON_Object"));
CurrentPwdCheck();
NewpwdCheck();
btnSubmit= (Button) findViewById(R.id.btnSubmit);
btnSubmit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
try {
NewPwd();
} catch (IOException e) {
e.printStackTrace();
} catch (JSONException e) {
e.printStackTrace();
}
}
});
}
public void NewPwd() throws IOException, JSONException {
String myPwd=new_pwd.getText().toString();
String Surl="http://inmeets.com/ChangePwd.php?uid="+uid+"&NewPwd="+myPwd;
URL url = null;
HttpURLConnection conn = null;
url = new URL(Surl);
conn = (HttpURLConnection)url.openConnection();
conn.setRequestMethod("GET");
conn.setConnectTimeout(1000);
if( conn.getResponseCode()==203) {
Toast.makeText(getBaseContext(), "your password changed", Toast.LENGTH_SHORT).show();
}
}