Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void executeLogin(View v) throws JSONException {
- final EditText loginText = (EditText) findViewById(R.id.email_white_edit);
- final EditText loginPassword = (EditText) findViewById(R.id.password_edit);
- boolean net= executeCammand();
- boolean netstat= InternetCheck.isInternetAvailable();
- if (net==true&&netstat==true) {
- // System.out.println("net available");
- }
- else if (net==false) {
- // System.out.println("net unavailable");
- final AlertDialog.Builder ad = new AlertDialog.Builder(this);
- ad.setTitle("Error! ");
- // ad.setIcon(android.R.drawable.btn_star_big_on);
- ad.setPositiveButton("Close", null);
- ad.setMessage("No internet connection");
- ad.show();
- finishActivity(0);
- }
- String username = loginText.getText().toString();
- String password = loginPassword.getText().toString();
- String urlLogin = "http://ga.aquawams.com/api/xhr_request_user_info.php?username=" + username + "&password=" + password;
- String resultServer = gethttp.getHttpPost(urlLogin, params);
- String strError = "incorrect username and/or password";
- if(result.equals("false"))
- {
- // Dialog
- final AlertDialog.Builder ad = new AlertDialog.Builder(this);
- ad.setTitle("Error! ");
- // ad.setIcon(android.R.drawable.btn_star_big_on);
- ad.setPositiveButton("Close", null);
- ad.setMessage(strError);
- ad.show();
- // loginText.setText("");
- loginPassword.setText("");
- }else if (result.equals("true")){
- Intent newActivity = new Intent(this, drawer.class);
- startActivity(newActivity);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement