snipt

Ctrl+h for KB shortcuts

Java

Android Toast

1
2
3
4
5
6
public void MakeToastMessage(View v) {

    Toast mToast = Toast.makeText(getApplicationContext(), HELLO BUTTON MESSAGE, Toast.LENGTH_SHORT);
    mToast.show();

} //END MakeToastMessage
https://snipt.net/embed/a62ad042013f67a40c0957f806f0d891/
https://snipt.net/raw/a62ad042013f67a40c0957f806f0d891/
a62ad042013f67a40c0957f806f0d891
java
Java
6
2016-09-26T14:29:30
True
False
False
/api/public/snipt/39349/
-106
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="kd">public</span> <span class="kt">void</span> <span class="nf">MakeToastMessage</span><span class="o">(</span><span class="n">View</span> <span class="n">v</span><span class="o">)</span> <span class="o">{</span> </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a> <span class="n">Toast</span> <span class="n">mToast</span> <span class="o">=</span> <span class="n">Toast</span><span class="o">.</span><span class="na">makeText</span><span class="o">(</span><span class="n">getApplicationContext</span><span class="o">(),</span> <span class="err">“</span><span class="n">HELLO</span> <span class="n">BUTTON</span> <span class="n">MESSAGE</span><span class="err">”</span><span class="o">,</span> <span class="n">Toast</span><span class="o">.</span><span class="na">LENGTH_SHORT</span><span class="o">);</span> </span><span id="L-4"><a name="L-4"></a> <span class="n">mToast</span><span class="o">.</span><span class="na">show</span><span class="o">();</span> </span><span id="L-5"><a name="L-5"></a> </span><span id="L-6"><a name="L-6"></a><span class="o">}</span> <span class="c1">//END MakeToastMessage</span> </span></pre></div> </td></tr></table>
Toast, android, popup
Copyrighted, illegal, or inappropriate content? Email support@snipt.net.