Home > DeveloperSection > Forums > Display a Toast message in the top of the page in my android application
Chris S
Chris S

Total Post:48

Posted on    January-23-2015 10:05 PM

 Mobile Development Android  Java 

 1 Reply(s)
 481  View(s)
Rate this:

I m using the following line to make a Toast message displayed in my android application

Toast.makeText(InitActivity.this, InitActivity.this.getResources().getString(R.string.invalid_pin_code), Toast.LENGTH_SHORT).show();

But this message is displayed in the bootom of the page.

And I want to display it below an EditText in my page.

How to make that?

Monaj Singh
Monaj Singh

Total Post:41

Posted on    January-23-2015 10:28 PM

You need add this as programmatically like this in your code:

toast.setGravity(Gravity.TOP|Gravity.LEFT, 0, 0);


Modified On Apr-20-2016 02:22:06 AM

Don't want to miss updates? Please click the below button!

Follow MindStick