package com.example.mobilecatering; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.CheckBox; import android.widget.EditText; import android.widget.Toast; public class mcpakej1 extends Activity { private EditText phone; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.mcpakej1); phone = (EditText) findViewById(R.id.guest); findViewById(R.id.gobutton).setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { final String pass = phone.getText().toString(); if (!isValidPassword(pass)) { phone.setError("Invalid Number"); } } }); } public void goReceipt(View v) { Intent intent = new Intent(v.getContext(), doReceipt.class); intent.putExtra("phone", phone.getText().toString()); startActivityForResult(intent,0); } private boolean isValidPassword(String pass) { if (pass != null && pass.length() <= 10000) { return true; } return false; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)