I am accessing .net web services through my Android Application. If the user is successfully registered then log cat will show 1 as the response. If not it will show 0 and If some field is missing then it will show -1 as response. so is it possible to show a dialog box according to the log cat response?
If response is 1 then "successfully registered"
If response is 0 then "Try Again"
How can we do this?
Log.v("TAG", String.valueOf(resultsRequestSOAP)); with this I am getting the response in logcat
Help is always appreciated….Thanks!
In this piece of code,I want to add the required code to show the dialog box.
Button signin = (Button) findViewById(R.id.regsubmitbtn);
signin.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
showDialog(0);
t = new Thread() {
public void run() {
register();
try {
Thread.sleep(5000);
removeDialog(0);
// I want to show the dialog box like registered successfully after removing this dialog//
} catch (InterruptedException e) {
e.printStackTrace();
}
}
};
t.start();
}
});
@Override
protected Dialog onCreateDialog(int id) {
switch (id) {
case 0: {
dialog = new ProgressDialog(this);
dialog.setMessage("Registering...");
dialog.setIndeterminate(true);
dialog.setCancelable(true);
return dialog;
}
}
return null;
}
Write a method that will create dialogs according to a parameter. Then you just have to call this method with a right parameter to create a right dialog depending on the server’s response.