我正在使用此代码...请纠正它
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://........");
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;
}});
}}
答案 0 :(得分:1)
....新的AlertDialog.Builder( YourActivity.this )......