else if ( (amt.getText().toString().trim().length() txt1.getText().toString().trim().length())){
What are these two lines supposed to be doing?
Once you have checked that there is some text in your textbox, then you should try to convert it. You can then test that it lies within the range of acceptable values. You should also wrap the conversion in a try/catch block to capture invalid input.
[edit]
public void onClick(View v) {
string strAmount = amt.getText().toString().trim();
if (strAmount.isEmpty()){
Toast.makeText(myView.getContext(), "Enter Valid Amount", Toast.LENGTH_LONG).show();
}
else {
try {
tot = Double.parseDouble(strAmount);
if (tot < 0 || tot > maxAmount) {
}
tt=(tot / 100.0f) * 3+tot;
loadProducts2();
catch (NumberFormatException ne) {
Toast.makeText(myView.getContext(), strAmount + " is not a valid number", Toast.LENGTH_LONG).show();
}
}
[/edit]