---
title: "How to short time of Toast notification"  
description: "How to short time of Toast notification"  
author: "Anonymous User"  
published: 2015-03-05  
updated: 2015-03-05  
canonical: https://www.mindstick.com/forum/13002/how-to-short-time-of-toast-notification  
category: "android"  
tags: ["android"]  
reading_time: 1 minute  

---

# How to short time of Toast notification

**My [code](https://yourviews.mindstick.com/view/85458/alan-turing-the-mastermind-behind-cracking-the-enigma-code-during-world-war-ii) is**

Toast.makeText(getApplicationContext(), "My [message](https://www.mindstick.com/forum/12802/show-confirmation-message-yes-or-no-in-asp-dot-net)", Toast.LENGTH_SHORT).show();

how to show [notification](https://www.mindstick.com/blog/205/property-notification-in-c-sharp) for two [second](https://answers.mindstick.com/qa/41761/how-did-the-second-industrial-revolution-influence-women-s-roles-in-society)

## Replies

### Reply by Manoj Pandey

Use following code instead of your code

```
final Toast toast = Toast.makeText(getApplicationContext(), "My message",				Toast.LENGTH_SHORT);		toast.show();		toast.setGravity(Gravity.CENTER, 0, 0);		new CountDownTimer(2000, 2000) {			@Override			public void onTick(long millisUntilFinished) {				toast.show();			}			@Override			public void onFinish() {				toast.cancel();			}		}.start();
```


---

Original Source: https://www.mindstick.com/forum/13002/how-to-short-time-of-toast-notification

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
