where to put checking edittext syntax?
===

i need a favor.. i'm confused to put these codes to check whether the edittext is empty or not:

    String input = editText.getText().toString();

    if(input == null || input.trim().equals("")){
      Toast.makeText(context, "Sorry you did't type anything"), Toast.LENGTH_SHORT).show();
    }


where must i write these codes? is it between these codes?

    public void onCreate(Bundle savedInstanceState) {
											
		super.onCreate(savedInstanceState);
		setContentView(R.layout.menuawal);
    ...
    ...
    ...

    JmlAhliWarisAnakLK = (EditText) findViewById(R.id.JmlAhliWarisAnakLK);
    JmlAhliWarisAnakPR = (EditText)findViewById(R.id.JmlAhliWarisAnakPR);

or in this function after double sisa=0;??

    public void cc() {
		
		int JmlWarisAnakPR = Integer.parseInt(JmlAhliWarisAnakPR.getText().toString());
		int JmlWarisAnakLK = Integer.parseInt(JmlAhliWarisAnakLK.getText().toString());
		int JmlHarta = Integer.parseInt(JmlHartaPeninggalan.getText().toString());
		double HasilSuami = 0;
		double HasilIstri = 0;
		double HasilAnakLK = 0;
		double HasilAnakPR = 0;
		double sisa = 0;
		
		
		
		}

please correct me if i'm wrong.. :D



