JayVDiyk JayVDiyk - 1 year ago 96
Android Question

Create a Toast that Comes From Top of Screen

I am wondering how do we create a Custom toast in Android that shows on the top of screen like this?

enter image description here

I came from iOS background and now I have to create custom controls like this.

Any pointers please?

Thank you

Answer Source

Check this link: https://github.com/gfranks/GFMinimalNotifications, this is what you want i think and it is working fine for me.


enter image description here

Or you can prepare custom toast like this:

View layout = getLayoutInflater().inflate(R.layout.customtoast,
            (ViewGroup) findViewById(R.id.custom_toast_layout));
Toast toast = new Toast(getApplicationContext());
toast.setGravity(Gravity.TOP, 0, 0);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download