In my Android application I get two different types of Toast message by giving getApplicationContext()
and MainActivity.this
Method 1:
Toast.makeText(getApplicationContext(),"No more items.", Toast.LENGTH_LONG).show();
produce the following output:
Method 2:
Toast.makeText(MainActivity.this,"No more items.", Toast.LENGTH_LONG).show();
second method produce the following toast message which differ from the first one.
I do not know the reason between getApplicationContext()
and MainActivity.this
for producing two different toast messages. please share reason behind the difference.
I run under Android Kitkat 4.4.2
in Samsung S4.