Snipt.net is closing on December 31st, 2016

For more information, please visit this blog post.

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-12-10T14:12:59
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></span><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

JavaScript

jQuery: pop-up content in defined area

1
2
3
4
5
6
// onmouseover == hover

$('.popup-1').hover(
       function() { $('#popup-region').html("<img src='sample.jpg'/>"); }, 
       function() { $('#popup-region').html(''); }
);
https://snipt.net/embed/f784861172bf3d2b2c6dd66f86123e13/
https://snipt.net/raw/f784861172bf3d2b2c6dd66f86123e13/
f784861172bf3d2b2c6dd66f86123e13
js
JavaScript
6
2016-12-05T19:55:58
True
False
False
/api/public/snipt/22903/
jquery-pop-up-content-in-defined-area
<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></span><span id="L-1"><a name="L-1"></a><span class="c1">// onmouseover == hover</span> </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a><span class="nx">$</span><span class="p">(</span><span class="s1">&#39;.popup-1&#39;</span><span class="p">).</span><span class="nx">hover</span><span class="p">(</span> </span><span id="L-4"><a name="L-4"></a> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span> <span class="nx">$</span><span class="p">(</span><span class="s1">&#39;#popup-region&#39;</span><span class="p">).</span><span class="nx">html</span><span class="p">(</span><span class="s2">&quot;&lt;img src=&#39;sample.jpg&#39;/&gt;&quot;</span><span class="p">);</span> <span class="p">},</span> </span><span id="L-5"><a name="L-5"></a> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span> <span class="nx">$</span><span class="p">(</span><span class="s1">&#39;#popup-region&#39;</span><span class="p">).</span><span class="nx">html</span><span class="p">(</span><span class="s1">&#39;&#39;</span><span class="p">);</span> <span class="p">}</span> </span><span id="L-6"><a name="L-6"></a><span class="p">);</span> </span></pre></div> </td></tr></table>
jquery, js, mouseover, popup
Copyrighted, illegal, or inappropriate content? Email [email protected].