To send an information to user,
we can use toast, for example, to inform that text in EditText doesn’t satify
requirement.
Toast.makeText(class.this,"Data enter not valid", Toast.LENGTH_SHORT).show();
That toast will show at screen’s
bottom. To set position at center screen , we use.
Toast toast = Toast.makeText(class.this, "Data
enter not valid ",Toast.LENGTH_SHORT);
toast.setGravity(Gravity.CENTER, 0, 0);
toast.show();
No comments:
Post a Comment