开发者

What context should I use AlertDialog.builder on event of a button ?

开发者 https://www.devze.com 2023-01-31 18:29 出处:网络
I am using this code... please rectify it btnLogin.setOnClickListener(new OnClickListener() { @Override

I am using this code... please rectify it

btnLogin.setOnClickListener(new OnClickListener() 
        {
        @Override
        public void onClick(View v)  
        {
         // Check Login
         String username = etUsername.getText().toString();
         String password = etPassword.getText().toString();

          String str1 = DownloadText("http://........");
     开发者_StackOverflow社区     if(str1.length()==1)
          {

          AlertDialog dialog = new AlertDialog.Builder(btnLogin).setTitle("Alert 1").setMessage("Login Success").create();
           alertDialog.setButton("OK", new DialogInterface.OnClickListener() {
                             public void onClick(DialogInterface dialog, int which) {
                                     return;
                             }});
}}


....new AlertDialog.Builder(YourActivity.this)......

0

精彩评论

暂无评论...
验证码 换一张
取 消