package com.android.quizzle;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
public class SettingsActivity extends Activity {
final EditText p1 = (EditText) findViewById(R.id.EditText_Pwd1);
final EditText p2 = (EditText) findViewById(R.id.EditText_Pwd2);
final TextView error = (TextView) findViewById(R.id.TextView_PwdProblem);
private static final int Password_Dialog = 1;
protected Dialog onCreateDialog(int id) {
LayoutInflater factory = LayoutInflater.from(this);
final View textEntryView = factory.inflate(R.layout.password, null);
p2.addTextChangedListener(new TextWatcher() {
public void afterTextChanged(Editable s) {
String strPass1 = p1.getText().toString();
String strPass2 = p2.getText().toString();
if (strPass1.equals(strPass2)) {
error.setText(R.string.match);
error.setText(R.string.dismatch);
public void beforeTextChanged(CharSequence arg0,
int arg1, int arg2, int arg3) {
public void onTextChanged(CharSequence arg0,
int arg1, int arg2, int arg3) {