Sunday 29 December 2019

android dialog box not running

this is my code in which the app is running just fine but the dialog box is not opening the button is clickable but no action is being performed



@Override
public void onClick(View view){
AlertDialog.Builder mBuilder = new AlertDialog.Builder(appointmentpage.this);
View mView = getLayoutInflater().inflate(R.layout.dialog_otp,null);
final EditText mOTP = (EditText) mView.findViewById(R.id.enterOTP);

final Button mVerify = (Button) mView.findViewById(R.id.verify);

mVerify.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if(mOTP.getText().toString().isEmpty())
{
mVerify.setOnClickListener(new View.OnClickListener(){

@Override

public void onClick(View view) {
AlertDialog.Builder mBuilder1 = new AlertDialog.Builder(appointmentpage.this);
View mView1 = getLayoutInflater().inflate(R.layout.confirmation_final,null);



}
});
}
else{

Toast.makeText(appointmentpage.this,
"Enter OTP",
Toast.LENGTH_SHORT).show();
}
}

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...