开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜