我创建了一个屏幕,它将询问密码并与内置密码进行比较并启动另一个屏幕,但即使我提供了正确的密码,我也无法启动该活动。任何帮助将不胜感激。
public class MainActivity extends Activity {
public static String lock = "vamsi";
public static String locker;
EditText et;
Button b;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
et = (EditText) findViewById(R.id.editText1);
b = (Button) findViewById(R.id.button1);
locker = et.getText().toString();
b.setOnClickListener(new View.OnClickListener() {
public void onClick(View arg0) {
if (locker.equals(lock)) {
Intent intent = new Intent("screen");
startActivity(intent);
}
}
});
}
}