DISPLAY A TOAST MESSAGE IN THE TOP OF THE PAGE IN MY ANDROID APPLICATION

Chris S

Total Post:48

Points:336
Posted by  Chris S
 805  View(s)
Ratings:
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?

  1. Monaj Singh

    Post:41

    Points:287
    Re: Display a Toast message in the top of the page in my android application

    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

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!