Reputation: 180
I wrote an Application in which we can add items to the list view..i'm doing validation for that if any one making the same entry it should display an alert
Toast.makeText(getApplicationContext(), "Serial No Already Exist..",Toast.LENGTH_LONG);
But it not displaying while I'm running on emulator. I'm sure that my validation code is correct.
Upvotes: 3
Views: 231
Reputation: 10969
Everything is perfect except one that you forget to append .Show()
at the end, and also check this .
Toast.makeText(getApplicationContext(), "Serial No Already Exist..",Toast.LENGTH_LONG).Show();
Instead#
Toast.makeText(getApplicationContext(), "Serial No Already Exist..",Toast.LENGTH_LONG);
Upvotes: 2
Reputation: 1667
Try:
Toast.makeText(getApplicationContext(), "Serial No Already Exist..",Toast.LENGTH_LONG).show();
Upvotes: 7
Reputation: 7110
add the show() to the toast like this
Toast.makeText(getApplicationContext(), "Serial No Already Exist..",Toast.LENGTH_LONG).show();
You need to specify show() to make the toast visible
Upvotes: 2