<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5185910518697051325</id><updated>2024-09-09T21:09:20.602-07:00</updated><title type='text'>The Headsman</title><subtitle type='html'>Desenvolvimento Android, IOS, Smartphone, Tablet.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://theheadsman.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5185910518697051325/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://theheadsman.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05559454207956023443</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>6</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5185910518697051325.post-2133063047979106188</id><published>2012-05-25T23:11:00.001-07:00</published><updated>2012-05-25T23:11:47.550-07:00</updated><title type='text'>Criando animação quadro a quadro com AnimationDrawable</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #6aa84f; font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: large;&quot;&gt;( Android )&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Neste tutorial vou demonstrar como é fácil criar uma animação Quadro a Quadro utilizando a classe AnimationDrawable.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;A maneira mais simples de criar uma animação quadro a quadro é definir a animação em um arquivo XML, colocado no res/drawable, e defini-la como background de um objeto View. No nosso caso será um objeto ImageView.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Então chega de papo e vamos lá !!!&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Crie um novo projeto Android no Eclipse.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Eu vou chama-lo de Exemplo Animation. &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;print do projeto:&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgG2zWqTmajakFtGm2YVmdKzfUdGcX6z_KxqXR8A2OlLMIdbmzDUqCLrvuTf1V9FFUsnWxOvBYUvTc5N3hO10kHm-4RSX85IriUO0PbXadtMvCwg6fZqxywCHYlJFzmOakYuW_0iAToQpwY/s1600/tela1.tiff&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;225&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgG2zWqTmajakFtGm2YVmdKzfUdGcX6z_KxqXR8A2OlLMIdbmzDUqCLrvuTf1V9FFUsnWxOvBYUvTc5N3hO10kHm-4RSX85IriUO0PbXadtMvCwg6fZqxywCHYlJFzmOakYuW_0iAToQpwY/s400/tela1.tiff&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Antes de proseguir, baixe as imagens que serão utilizadas no exemplo, e salve-as nas pastas res/drawable-hdpi ,&amp;nbsp;drawable-ldpi ,&amp;nbsp;drawable-mdpi.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;download: &lt;a href=&quot;http://www.theheadsman.com.br/imagens_anima.zip&quot;&gt;www.theheadsman.com.br/imagens_anima.zip&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;O próximo passo será criar o arquivo XML.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Para criar o XML, selecione a pasta RES do projeto, clique com o botão direito, depois NEW &amp;nbsp;/ &amp;nbsp;OTHER... / PASTA ANDROID. &amp;nbsp;Na tela de dilalogo selecione ANDROID XML FILE e aperte o botão NEXT.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;print &amp;nbsp;tela de dialog:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQ6KXx4zyZi-A2ZuqS6kbnyDv-Y6JNZG_s4N6nrAa8lUtALil_GmMZHt9IIFdc8mDFjNCjO3SLLuJSQRdOWg93Y2wr_Sw9ZmMbqLCdd_apmRdyP19X8GQ0eBCi9sJmNXDRdgbtx14nlF_O/s1600/tela2.tiff&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;225&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQ6KXx4zyZi-A2ZuqS6kbnyDv-Y6JNZG_s4N6nrAa8lUtALil_GmMZHt9IIFdc8mDFjNCjO3SLLuJSQRdOWg93Y2wr_Sw9ZmMbqLCdd_apmRdyP19X8GQ0eBCi9sJmNXDRdgbtx14nlF_O/s400/tela2.tiff&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;na próxima tela:&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7wYW6Ni8PVm88yPHZxSn2KpFUQMpy1tvlSSdvii2xVOtJI567DUOO0eQUWMVzy7IBZt5LX0l07-j4wTm9btXourkK-kIlF5B2p8Ax7IW8SyoMJ8lj2vwB_8Y_MRn2vC91A_G3zSsnL-bS/s1600/tela3.tiff&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;225&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7wYW6Ni8PVm88yPHZxSn2KpFUQMpy1tvlSSdvii2xVOtJI567DUOO0eQUWMVzy7IBZt5LX0l07-j4wTm9btXourkK-kIlF5B2p8Ax7IW8SyoMJ8lj2vwB_8Y_MRn2vC91A_G3zSsnL-bS/s400/tela3.tiff&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Resource Type: drawable&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;File: O nome do XML&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Root Element:&amp;nbsp;animation-list&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Clique em finish e pronto.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Observe que foi criada uma nova pasta chamada drawable sem as definições de DPIs.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;print XML&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9-acqp1mFF4jBgmx2wlHslJ_iYzDm25G-xtsqzgBCZDHPFDtst5SSHDBskEpfdxn18uUF0AYUGT_Kbm3bpKXfByfsMsLsYm28ReABotU8kyBwHU4K5MaWRl-oA7NSiF_mEtcNfATBXf6j/s1600/tela4.tiff&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;225&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9-acqp1mFF4jBgmx2wlHslJ_iYzDm25G-xtsqzgBCZDHPFDtst5SSHDBskEpfdxn18uUF0AYUGT_Kbm3bpKXfByfsMsLsYm28ReABotU8kyBwHU4K5MaWRl-oA7NSiF_mEtcNfATBXf6j/s400/tela4.tiff&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Um AnimationDrawable definido no XML consiste de uma único&amp;nbsp;&amp;nbsp;elemento&amp;nbsp;&amp;lt;animation-list&amp;gt;, e uma série de tags &amp;lt;item&amp;gt; aninhadas.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Segue o XML:&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;color: #881e87; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: #008688;&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;span style=&quot;color: #448687;&quot;&gt;xml&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;version&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;1.0&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;encoding&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;utf-8&quot;&lt;/span&gt;&lt;span style=&quot;color: #008688;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #312eff; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: #008688;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #448687;&quot;&gt;animation-list&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #881e87;&quot;&gt;xmlns:android&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&quot;http://schemas.android.com/apk/res/android&quot;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #008688;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #881e87; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #008688;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #448687;&quot;&gt;item&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;android:drawable&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;@drawable/anima1&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;android:duration&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;100&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #008688;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #881e87; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #008688;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #448687;&quot;&gt;item&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;android:drawable&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;@drawable/anima2&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;android:duration&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;100&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #008688;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #881e87; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #008688;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #448687;&quot;&gt;item&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;android:drawable&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;@drawable/anima4&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;android:duration&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;100&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #008688;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #881e87; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #008688;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #448687;&quot;&gt;item&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;android:drawable&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;@drawable/anima6&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;android:duration&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;100&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #008688;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #881e87; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #008688;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #448687;&quot;&gt;item&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;android:drawable&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;@drawable/anima8&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;android:duration&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;100&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #008688;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #881e87; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #008688;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #448687;&quot;&gt;item&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;android:drawable&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;@drawable/anima9&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;android:duration&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;100&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #008688;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #881e87; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #008688;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #448687;&quot;&gt;item&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;android:drawable&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;@drawable/anima10&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;android:duration&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;100&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #008688;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #881e87; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #008688;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #448687;&quot;&gt;item&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;android:drawable&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;@drawable/anima11&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;android:duration&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;100&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #008688;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #881e87; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #008688;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #448687;&quot;&gt;item&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;android:drawable&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;@drawable/anima12&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;android:duration&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;100&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #008688;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #881e87; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #008688;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #448687;&quot;&gt;item&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;android:drawable&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;@drawable/anima13&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;android:duration&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;100&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #008688;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #881e87; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #008688;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #448687;&quot;&gt;item&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;android:drawable&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;@drawable/anima14&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;android:duration&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;100&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #008688;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #881e87; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #008688;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #448687;&quot;&gt;item&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;android:drawable&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;@drawable/anima15&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;android:duration&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;100&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #008688;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #881e87; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #008688;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #448687;&quot;&gt;item&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;android:drawable&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;@drawable/anima16&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;android:duration&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;100&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #008688;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #448687; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: #008688;&quot;&gt;&amp;lt;/&lt;/span&gt;animation-list&lt;span style=&quot;color: #008688;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #881e87; font-family: Monaco; font-size: 11px;&quot;&gt;android:drawable&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #881e87; font-size: 11px;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Monaco;&quot;&gt;=&quot;&quot; &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;-&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;carrega as imagens que foram salvas anteriormente nas pastas drawable.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #881e87; font-family: Monaco; font-size: 11px;&quot;&gt;android:duration&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #881e87; font-family: Monaco; font-size: 11px;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #881e87; font-family: Monaco; font-size: 11px;&quot;&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;- define o tempo de cada frame em milisegundos.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;O nosso XML animation-list está configurado, agora vamos criar o componente ImageView onde serão carregadas as imagens da animação. &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;res/layout/main.xml &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #008688;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;color: #881e87; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #008688;&quot;&gt;&lt;span style=&quot;color: #008688;&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;span style=&quot;color: #448687;&quot;&gt;xml&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;version&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;1.0&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;encoding&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;utf-8&quot;&lt;/span&gt;&lt;span style=&quot;color: #008688;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #008688;&quot;&gt;
&lt;div style=&quot;color: #312eff; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: #008688;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #448687;&quot;&gt;LinearLayout&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #881e87;&quot;&gt;xmlns:android&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&quot;http://schemas.android.com/apk/res/android&quot;&lt;/div&gt;
&lt;div style=&quot;color: #881e87; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;android:layout_width&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #881e87; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;android:layout_height&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #881e87; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;android:orientation&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;vertical&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #008688;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #448687; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #008688;&quot;&gt;&amp;lt;&lt;/span&gt;ImageView&lt;/div&gt;
&lt;div style=&quot;color: #312eff; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #881e87;&quot;&gt;android:id&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&quot;@+id/animacao&quot;&lt;/div&gt;
&lt;div style=&quot;color: #881e87; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;android:layout_width&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #881e87; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;android:layout_height&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #881e87; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;android:layout_gravity&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;center_horizontal&quot;&lt;/span&gt;&lt;span style=&quot;color: #008688;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #448687; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: #008688;&quot;&gt;&amp;lt;/&lt;/span&gt;LinearLayout&lt;span style=&quot;color: #008688;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;E por fim, na nossa activity:&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: #88185d;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #88185d;&quot;&gt;class&lt;/span&gt; ExemploAnimation &lt;span style=&quot;color: #88185d;&quot;&gt;extends&lt;/span&gt; Activity {&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #88185d;&quot;&gt;private&lt;/span&gt; ImageView &lt;span style=&quot;color: #0023c5;&quot;&gt;animaHorse&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #6c6c6c; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/span&gt;@Override&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #88185d;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #88185d;&quot;&gt;void&lt;/span&gt; onCreate(Bundle savedInstanceState) {&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color: #88185d;&quot;&gt;super&lt;/span&gt;.onCreate(savedInstanceState);&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;setContentView(R.layout.&lt;span style=&quot;color: #0023c5;&quot;&gt;main&lt;/span&gt;);&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #448567; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;// &lt;span style=&quot;text-decoration: underline;&quot;&gt;Carrega&lt;/span&gt; o ImageView e define o background &lt;span style=&quot;text-decoration: underline;&quot;&gt;para&lt;/span&gt; o &lt;span style=&quot;text-decoration: underline;&quot;&gt;nosso&lt;/span&gt; XML&lt;/div&gt;
&lt;div style=&quot;color: #448567; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;// AnimationDrawable&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color: #0023c5;&quot;&gt;animaHorse&lt;/span&gt; = (ImageView) findViewById(R.id.&lt;span style=&quot;color: #0023c5;&quot;&gt;animacao&lt;/span&gt;);&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color: #0023c5;&quot;&gt;animaHorse&lt;/span&gt;.setBackgroundResource(R.drawable.&lt;span style=&quot;color: #0023c5;&quot;&gt;animation&lt;/span&gt;);&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;AnimationDrawable frameAnimaHorse = (AnimationDrawable) &lt;span style=&quot;color: #0023c5;&quot;&gt;animaHorse&lt;/span&gt;.getBackground();&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #448567; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;// &lt;span style=&quot;text-decoration: underline;&quot;&gt;Inicia&lt;/span&gt; a &lt;span style=&quot;text-decoration: underline;&quot;&gt;animação&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;frameAnimaHorse.start();&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
}&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Rode a aplicação.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: orange; font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Obs: Teste em um aparelho real, a animação não está rodando com o virtual device.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;O play da animação é um loop por padão&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Mas se quiser que a animação rode uma vez e pare, utilize o método setOneShot() da classe AnimationDrawable. &amp;nbsp;Por padrão o método setOnShot() recebe false como parâmetro. Passe true para que rode uma vez.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Monaco;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 11px;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Monaco;&quot;&gt;frameAnimaHorse.setOneShot(&lt;span style=&quot;color: #88185d;&quot;&gt;true&lt;/span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Faça um teste:&lt;br /&gt;
Crie um botão e chame o método stop() no objeto de instancia frameAnimaHorse.&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Monaco; font-size: 11px;&quot;&gt;frameAnimaHorse.stop();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Monaco; font-size: 11px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
O método IsRunning() indica se a animação está sendo executada ou não - retorna um valor boleano.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pesquise mais sobre a API.&lt;br /&gt;
&lt;a href=&quot;http://developer.android.com/reference/packages.html&quot;&gt;http://developer.android.com/reference/packages.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Valeu, fui !!!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://theheadsman.blogspot.com/feeds/2133063047979106188/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://theheadsman.blogspot.com/2012/05/criando-animacao-quadro-quadro-com.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5185910518697051325/posts/default/2133063047979106188'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5185910518697051325/posts/default/2133063047979106188'/><link rel='alternate' type='text/html' href='http://theheadsman.blogspot.com/2012/05/criando-animacao-quadro-quadro-com.html' title='Criando animação quadro a quadro com AnimationDrawable'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05559454207956023443</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgG2zWqTmajakFtGm2YVmdKzfUdGcX6z_KxqXR8A2OlLMIdbmzDUqCLrvuTf1V9FFUsnWxOvBYUvTc5N3hO10kHm-4RSX85IriUO0PbXadtMvCwg6fZqxywCHYlJFzmOakYuW_0iAToQpwY/s72-c/tela1.tiff" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5185910518697051325.post-8378526052146141475</id><published>2012-05-16T19:20:00.000-07:00</published><updated>2012-05-17T08:15:10.224-07:00</updated><title type='text'>Convertendo pixels em dp e vice-versa</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #6aa84f; font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: large;&quot;&gt;( Android )&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Eu tive alguns problemas com o tamanho dos objetos customizados no android utilizando a API do Java em telas com densidades diferentes, e vou demonstrar como resolver esse problema, uma vez que o Java utiliza pixels como unidade de medida e não dp. &amp;nbsp;Mas antes vou falar um pouco de tamanho de tela (screen size).&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Essa medida refere-se ao tamanho físico da tela, medida na diagonal. &amp;nbsp;O &amp;nbsp;Android atualmente separa os tamanhos físicos de tela em quatro diferentes categorias, que são: &amp;nbsp;tela pequena small, tela normal normal, tela grande large, tela extragrande xlarge.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Vou dar um exemplo mais claro de cada nomenclatura com aparelhos reais.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;small: &lt;/span&gt;&lt;/b&gt;&amp;nbsp;Sony Ericsson, Xperia Mini, &amp;nbsp;que possuem uma pequena tela QVGA de 240 x 320 pixels&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;normal: &lt;/span&gt;&lt;/b&gt;HTC G1, HTC Magic , Motorola DEXT, possuem uma tela HVGA média 320 x 480 pixels. Nesse grupo também se encontram os celulares um pouco maiores como o Nexus One, Sony &amp;nbsp;Xperia X10, Mororola Milestone, Samsung Galaxy S, que possuem telas WVGA que varia entre 480 x 800 e 480 x 854 pixels.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;large: &lt;/span&gt;&lt;/b&gt;O tablet Samsung Galaxy Tab de 7&quot;, que possui tela WVGA de 1024 x 600 pixels&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;xlarge:&lt;/span&gt;&lt;/b&gt; Os novos tablets com Andoids 3.x, com tela WXGA de 1280 x 800 pixels&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: orange; font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;Obs:&lt;/b&gt; Essas medidas de tela são aproximadas e podem ter variações.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;A resolução da tela é expressa em pixels, por exemplo, 320 x 480 px. Diferente do Iphone, no Android temos diversos celulares ,com &amp;nbsp;resoluções diferentes, o que torna a vida do desenvolvedor android mais emocionante &amp;nbsp;( Risos ). &amp;nbsp;Assim, no desenvolvimento dos aplicativos devemos evitar utilizar essa notação para definir os tamanhos das views, valores de margens, espaçamentos e qualquer outro parâmetro. No Android nunca trabalhamos diretamente com pixels, e sim com dp (density-independent pixel).&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Densidade da tela é basicamente a relação entre a quantidade de pixels existentes na tela com a sua largura e altura. Quanto maior a densidade, maior será a quantidade de pixels espalhados pela tela.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Bem, agora é fácil, é só eu usar dp ao invés de px que todos os meus problemas estão resolvidos.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Mas e se você criar uma view customizada com o Canvas ao invés do xml por exemplo ?&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Como eu havia explicado anteriormente, o Java utiliza a notação de pixels para definir valores.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Então chega de falar e vamos ao código.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Digamos que estamos criando uma view customizada e precisamos desenhar um quadrado na tela. Para isso precisamos utilizar a API de desenho. Vamos lá.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;1 -&lt;/b&gt; Crie um projeto android no eclipse.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;2 - &lt;/b&gt;Crie uma classe TesteView para API de desenho.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;print do projeto.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjE7lu5otr_XGzr3oWGltFfRLwdbgIkkXy7aAJSBhytO0GHOe3OjLOR56IgZ3pfChBeCv0LleZNuP9Zdxrcq4w9ub03xdf5PROV_eO3Lpo_4mZQxnb6xRfiBBNNWwWzK9P1GUz99r8tKZZ/s1600/telaProjeto.tiff&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;225&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjE7lu5otr_XGzr3oWGltFfRLwdbgIkkXy7aAJSBhytO0GHOe3OjLOR56IgZ3pfChBeCv0LleZNuP9Zdxrcq4w9ub03xdf5PROV_eO3Lpo_4mZQxnb6xRfiBBNNWwWzK9P1GUz99r8tKZZ/s400/telaProjeto.tiff&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;O código da Activity é simples, vamos apenas alterar o setContentView();&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: #88185d;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #88185d;&quot;&gt;class&lt;/span&gt; ExemploConverPixelDP &lt;span style=&quot;color: #88185d;&quot;&gt;extends&lt;/span&gt; Activity {&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #6c6c6c; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;@Override&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #88185d;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #88185d;&quot;&gt;void&lt;/span&gt; onCreate(Bundle savedInstanceState) {&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #88185d;&quot;&gt;super&lt;/span&gt;.onCreate(savedInstanceState);&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; setContentView(&lt;span style=&quot;color: #88185d;&quot;&gt;new&lt;/span&gt; TesteView(&lt;span style=&quot;color: #88185d;&quot;&gt;this&lt;/span&gt;));&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&amp;nbsp; &amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
}&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times; font-size: small;&quot;&gt;Segue o código da classe TesteView.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times; font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times; font-size: small;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times; font-size: small;&quot;&gt;&lt;span style=&quot;color: #88185d;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #88185d;&quot;&gt;class&lt;/span&gt; TesteView &lt;span style=&quot;color: #88185d;&quot;&gt;extends&lt;/span&gt; View {&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times; font-size: small;&quot;&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times; font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times; font-size: small;&quot;&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #88185d;&quot;&gt;private&lt;/span&gt; Paint &lt;span style=&quot;color: #0023c5;&quot;&gt;paint&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times; font-size: small;&quot;&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times; font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times; font-size: small;&quot;&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #88185d;&quot;&gt;public&lt;/span&gt; TesteView(Context context) {&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times; font-size: small;&quot;&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color: #88185d;&quot;&gt;super&lt;/span&gt;(context);&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times; font-size: small;&quot;&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times; font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times; font-size: small;&quot;&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color: #0023c5;&quot;&gt;paint&lt;/span&gt; = &lt;span style=&quot;color: #88185d;&quot;&gt;new&lt;/span&gt; Paint();&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times; font-size: small;&quot;&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times; font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times; font-size: small;&quot;&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color: #0023c5;&quot;&gt;paint&lt;/span&gt;.setColor(Color.&lt;span style=&quot;color: #0023c5;&quot;&gt;LTGRAY&lt;/span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times; font-size: small;&quot;&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color: #0023c5;&quot;&gt;paint&lt;/span&gt;.setStyle(Style.&lt;span style=&quot;color: #0023c5;&quot;&gt;FILL&lt;/span&gt;);&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #6c6c6c; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/span&gt;@Override&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #88185d;&quot;&gt;protected&lt;/span&gt; &lt;span style=&quot;color: #88185d;&quot;&gt;void&lt;/span&gt; onDraw(Canvas canvas) {&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color: #88185d;&quot;&gt;super&lt;/span&gt;.onDraw(canvas);&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;canvas.drawRect(0, 0, 320 / 2, 480 / 2, &lt;span style=&quot;color: #0023c5;&quot;&gt;paint&lt;/span&gt;);&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
}&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Rode e veja o resultado.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Nós sabemos que existem telas HVGA de 320 x 480 pixels e, portanto o quadrado vai ocupar a metade do tamanho da tela. Mas o que acontece se executarmos o mesmo exemplo em uma tela de maior densidade, como uma WVGA de 480 x 800 pixels.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Segue o print do exemplo executado no virtual divice com a tela&amp;nbsp;HVGA de 320 x 480 pixels a esquerda, e a direita a tela&amp;nbsp;WVGA de 480 x 800 pixels.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPMz0KvqBSUEDjgL4D34hGr5RnmOL8WTidPQcyjfiX8b3B1oR1maoji5vFLRue3r0QVCPuqHb1nZmGcuzUQnAFmCKclGFQSs8qaDjD9CX667B_ZLXf_zo-Bb9TW9Itr_1N8ZfpWaeqyL1C/s1600/virtualdevice.tiff&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;225&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPMz0KvqBSUEDjgL4D34hGr5RnmOL8WTidPQcyjfiX8b3B1oR1maoji5vFLRue3r0QVCPuqHb1nZmGcuzUQnAFmCKclGFQSs8qaDjD9CX667B_ZLXf_zo-Bb9TW9Itr_1N8ZfpWaeqyL1C/s400/virtualdevice.tiff&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Como podemos verificar, na tela HVGA, o exemplo funcionou como o esperado, e nosso quadrado que (na verdade é um retângulo) preenche exatamente a metade da tela. Isso porque colocamos o valor fixo em pixels no método de desenho. &amp;nbsp;Mas ao executarmos o mesmo exemplo em um aparelho de densidade mais alta o resultado foi diferente. O &quot;quadrado&quot; foi reduzido, pois a quantidade de pixels é maior nessa tela. E agora, o que fazemos ?&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;A solução é pensar que esses valores de 320 x 480 pixels na verdade estão em dp ( density-independent pixel) e fazer a conversão do valor de dp para pixels. &amp;nbsp;Se fosse um arquivo XML de layout bastava colocar a notação em (dp) que tudo ficava lindo, mas em Java teremos que fazer a conversão manualmente.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Método que converte os valores:&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: #88185d;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #88185d;&quot;&gt;float&lt;/span&gt; toPixel(Context context, &lt;span style=&quot;color: #88185d;&quot;&gt;float&lt;/span&gt; dip) {&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Resources r = context.getResources();&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color: #88185d;&quot;&gt;float&lt;/span&gt; densidade = r.getDisplayMetrics().&lt;span style=&quot;color: #0023c5;&quot;&gt;density&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color: #88185d;&quot;&gt;int&lt;/span&gt; px = (&lt;span style=&quot;color: #88185d;&quot;&gt;int&lt;/span&gt;) (dip * densidade + 0.5f);&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color: #88185d;&quot;&gt;return&lt;/span&gt; px;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;Segue o código completo:&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times; font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times; font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: #88185d;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #88185d;&quot;&gt;class&lt;/span&gt; TesteView &lt;span style=&quot;color: #88185d;&quot;&gt;extends&lt;/span&gt; View {&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #88185d;&quot;&gt;private&lt;/span&gt; Paint &lt;span style=&quot;color: #0023c5;&quot;&gt;paint&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #88185d;&quot;&gt;public&lt;/span&gt; TesteView(Context context) {&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color: #88185d;&quot;&gt;super&lt;/span&gt;(context);&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color: #0023c5;&quot;&gt;paint&lt;/span&gt; = &lt;span style=&quot;color: #88185d;&quot;&gt;new&lt;/span&gt; Paint();&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color: #0023c5;&quot;&gt;paint&lt;/span&gt;.setColor(Color.&lt;span style=&quot;color: #0023c5;&quot;&gt;LTGRAY&lt;/span&gt;);&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color: #0023c5;&quot;&gt;paint&lt;/span&gt;.setStyle(Style.&lt;span style=&quot;color: #0023c5;&quot;&gt;FILL&lt;/span&gt;);&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #6c6c6c; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/span&gt;@Override&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #88185d;&quot;&gt;protected&lt;/span&gt; &lt;span style=&quot;color: #88185d;&quot;&gt;void&lt;/span&gt; onDraw(Canvas canvas) {&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color: #88185d;&quot;&gt;super&lt;/span&gt;.onDraw(canvas);&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #448567; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;// &lt;span style=&quot;text-decoration: underline;&quot;&gt;valores&lt;/span&gt; &lt;span style=&quot;text-decoration: underline;&quot;&gt;em&lt;/span&gt; &lt;span style=&quot;text-decoration: underline;&quot;&gt;dp&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color: #88185d;&quot;&gt;float&lt;/span&gt; larguraDP = 320;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color: #88185d;&quot;&gt;float&lt;/span&gt; alturaDP = 480;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #448567; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;// &lt;span style=&quot;text-decoration: underline;&quot;&gt;convertendo&lt;/span&gt; &lt;span style=&quot;text-decoration: underline;&quot;&gt;para&lt;/span&gt; pixels&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color: #88185d;&quot;&gt;float&lt;/span&gt; larguraPX = toPixel(getContext(), larguraDP);&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color: #88185d;&quot;&gt;float&lt;/span&gt; alturaPX = toPixel(getContext(), alturaDP);&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #448567; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;// &lt;span style=&quot;text-decoration: underline;&quot;&gt;desenha&lt;/span&gt; o &lt;span style=&quot;text-decoration: underline;&quot;&gt;quadrado&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;canvas.drawRect(0, 0, larguraPX / 2, alturaPX / 2, &lt;span style=&quot;color: #0023c5;&quot;&gt;paint&lt;/span&gt;);&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #448567; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/span&gt;// &lt;span style=&quot;text-decoration: underline;&quot;&gt;converte&lt;/span&gt; &lt;span style=&quot;text-decoration: underline;&quot;&gt;de&lt;/span&gt; DP &lt;span style=&quot;text-decoration: underline;&quot;&gt;para&lt;/span&gt; Pixels&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #88185d;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #88185d;&quot;&gt;float&lt;/span&gt; toPixel(Context context, &lt;span style=&quot;color: #88185d;&quot;&gt;float&lt;/span&gt; dip) {&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Resources r = context.getResources();&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color: #88185d;&quot;&gt;float&lt;/span&gt; densidade = r.getDisplayMetrics().&lt;span style=&quot;color: #0023c5;&quot;&gt;density&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color: #88185d;&quot;&gt;int&lt;/span&gt; px = (&lt;span style=&quot;color: #88185d;&quot;&gt;int&lt;/span&gt;) (dip * densidade + 0.5f);&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color: #88185d;&quot;&gt;return&lt;/span&gt; px;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
}&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Agora rode e olhe o resultado.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;O nosso quadrado (retângulo) agora ocupa o mesmo espaço, nas duas talas com diferentes densidades.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;print do virtual device: &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6_xCa37yNdHwmNMGQ28H1r9F_Amwpnq5wLo_a0NfhCJ6d3seIkrE8Zk2j8IeHdZFvNPrC-SnokXr14tkpXAawiutLAg_zl3GWfKf3G-jjluXPU_gGHlvjGbPJbCfJDGjIg6MhQENSTvAr/s1600/telavirtualdevice2.tiff&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;225&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6_xCa37yNdHwmNMGQ28H1r9F_Amwpnq5wLo_a0NfhCJ6d3seIkrE8Zk2j8IeHdZFvNPrC-SnokXr14tkpXAawiutLAg_zl3GWfKf3G-jjluXPU_gGHlvjGbPJbCfJDGjIg6MhQENSTvAr/s400/telavirtualdevice2.tiff&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;Eu esqueci de mencionar !!!&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;tela QVGA&amp;nbsp;retorna a densidade de 0.75&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;tela HVGA&amp;nbsp;retorna a densidade de 1.0&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;tela WVGA&amp;nbsp;retorna a densidade de 1.5&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;Problema resolvido. &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Até mais !&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://theheadsman.blogspot.com/feeds/8378526052146141475/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://theheadsman.blogspot.com/2012/05/convertendo-pixels-em-dp-e-vice-versa.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5185910518697051325/posts/default/8378526052146141475'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5185910518697051325/posts/default/8378526052146141475'/><link rel='alternate' type='text/html' href='http://theheadsman.blogspot.com/2012/05/convertendo-pixels-em-dp-e-vice-versa.html' title='Convertendo pixels em dp e vice-versa'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05559454207956023443</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjE7lu5otr_XGzr3oWGltFfRLwdbgIkkXy7aAJSBhytO0GHOe3OjLOR56IgZ3pfChBeCv0LleZNuP9Zdxrcq4w9ub03xdf5PROV_eO3Lpo_4mZQxnb6xRfiBBNNWwWzK9P1GUz99r8tKZZ/s72-c/telaProjeto.tiff" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5185910518697051325.post-792751900564301675</id><published>2012-05-13T12:48:00.000-07:00</published><updated>2012-05-13T13:13:54.669-07:00</updated><title type='text'>Tela Splash Screen</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #6aa84f; font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: large;&quot;&gt;( Android )&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Vocês já devem ter visto alguma aplicação abrindo uma tela inicial com uma mensagem &quot;Por favor aguarde&quot;ou uma imagem , como por exemplo, a tela de jogo Angry Birds e a tela de iniciação do próprio eclipse. Essas telas são Splash Screens e para implementá-las no Android podemos utilizar um handler.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Uma tela splash screen deve permanecer aberta por um determinado tempo para que a aplicação consiga realizar algum processo inicial.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Esse tipo de funcionalidade impressiona o usuário, dando uma impressão de que a aplicação é bem robusta e profissional.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Vamos criar uma simples Activity que exibirá uma imagem na tela, a qual ficará aberta por 3 segundos.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Então vamos lá.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Para começar, crie um projeto android no eclipse. &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Print do projeto:&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIv0W3WQDPyI-VQAMOqLfPIgA2gmQXte3Uv_e3hY3Cby4Yd8QTfQTOPze1Ki-SK-8RUbMxG-6NzI17GhvjI9a9a6qCkd5DYtYASXv_Heho3LgahJktVWqgoaotmvr1GkkUgb5UbAGnC28g/s1600/tela1.tiff&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;180&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIv0W3WQDPyI-VQAMOqLfPIgA2gmQXte3Uv_e3hY3Cby4Yd8QTfQTOPze1Ki-SK-8RUbMxG-6NzI17GhvjI9a9a6qCkd5DYtYASXv_Heho3LgahJktVWqgoaotmvr1GkkUgb5UbAGnC28g/s320/tela1.tiff&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;A seguir, vamos configurar o nosso arquivo de layout. A configuração é bem simples, uma vez que vamos apenas abrir uma imagem na Tela Splash Screen.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Salve a imagem na pasta res/drawable do projeto.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Em seguida, crie um novo arquivo &amp;nbsp;de layout com o nome de splashscreen.xml e insira a tag do componente ImagView com as seguintes configurações:&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;color: #881e87; font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;android:layout_width&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #881e87; font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;android:layout_height&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #312eff; font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #881e87;&quot;&gt;android:src&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&quot;@drawable/bgpeixes&quot; &amp;nbsp; &amp;lt;!- Imagem --&amp;gt;&lt;/div&gt;
&lt;div style=&quot;color: #881e87; font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;android:layout_gravity&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;center&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #312eff;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;Imagem utilizada no exemplo:&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #881e87; font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span style=&quot;color: #312eff;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1SdvvwvScQWTZqCtgmpoujXkjVjyV8W_y7BULpvv5iAIyFwN2rvVto1xDEFOMGcyRnoZ5WUjKXPsumSOc_CEJhUQI4SVOyJaMSJybmd9YQrI86_C0fYSJUZhuNcHnsl4rX61GgfRAiV8c/s1600/bgpeixes.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1SdvvwvScQWTZqCtgmpoujXkjVjyV8W_y7BULpvv5iAIyFwN2rvVto1xDEFOMGcyRnoZ5WUjKXPsumSOc_CEJhUQI4SVOyJaMSJybmd9YQrI86_C0fYSJUZhuNcHnsl4rX61GgfRAiV8c/s320/bgpeixes.jpg&quot; width=&quot;192&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;color: #881e87; font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span style=&quot;color: #312eff;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #881e87; font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span style=&quot;color: #312eff;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;Segue o arquivo completo.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times; font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times; font-size: small;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #881e87; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times; font-size: small;&quot;&gt;&lt;span style=&quot;color: #008688;&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;span style=&quot;color: #448687;&quot;&gt;xml&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;version&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;1.0&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;encoding&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;utf-8&quot;&lt;/span&gt;&lt;span style=&quot;color: #008688;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times; font-size: small;&quot;&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;color: #312eff; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times; font-size: small;&quot;&gt;&lt;span style=&quot;color: #008688;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #448687;&quot;&gt;LinearLayout&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #881e87;&quot;&gt;xmlns:android&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&quot;http://schemas.android.com/apk/res/android&quot;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times; font-size: small;&quot;&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;color: #881e87; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times; font-size: small;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;android:layout_width&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times; font-size: small;&quot;&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;color: #881e87; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times; font-size: small;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;android:layout_height&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times; font-size: small;&quot;&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;color: #881e87; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times; font-size: small;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;android:orientation&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;vertical&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #008688;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times; font-size: small;&quot;&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times; font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times; font-size: small;&quot;&gt;
&lt;div style=&quot;color: #448687; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #008688;&quot;&gt;&amp;lt;&lt;/span&gt;ImageView&lt;/div&gt;
&lt;div style=&quot;color: #881e87; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;android:layout_width&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #881e87; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;android:layout_height&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #881e87; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;android:layout_gravity&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;center&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #312eff; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #881e87;&quot;&gt;android:src&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&quot;@drawable/bgpeixes&quot;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #008688;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #448687; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: #008688;&quot;&gt;&amp;lt;/&lt;/span&gt;LinearLayout&lt;span style=&quot;color: #008688;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #448687; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: #008688;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #312eff;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;Agora crie a activity &amp;nbsp;SplashScreen.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;Esta é a classe que envia um java.lang.Runnable para ser processado com atraso de 3 segundos.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;font-family: Times; font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div&gt;
&lt;div style=&quot;color: #6c6c6c;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #6c6c6c;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #6c6c6c;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #88185d;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #88185d;&quot;&gt;class&lt;/span&gt; SplashScreen &lt;span style=&quot;color: #88185d;&quot;&gt;extends&lt;/span&gt; Activity &lt;span style=&quot;color: #88185d;&quot;&gt;implements&lt;/span&gt; Runnable {&lt;/div&gt;
&lt;div style=&quot;color: #6c6c6c; font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #88185d;&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #88185d;&quot;&gt;final&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #88185d;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #0023c5;&quot;&gt;DELAY&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;3000&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #6c6c6c; font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #6c6c6c; font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/span&gt;@Override&lt;/div&gt;
&lt;div style=&quot;color: #6c6c6c; font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #88185d;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #88185d;&quot;&gt;void&lt;/span&gt; onCreate(Bundle savedInstanceState) {&lt;/div&gt;
&lt;div style=&quot;color: #6c6c6c; font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color: #88185d;&quot;&gt;super&lt;/span&gt;.onCreate(savedInstanceState);&lt;/div&gt;
&lt;div style=&quot;color: #6c6c6c; font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;setContentView(R.layout.&lt;span style=&quot;color: #0023c5;&quot;&gt;splashscreen&lt;/span&gt;);&lt;/div&gt;
&lt;div style=&quot;color: #6c6c6c; font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #6c6c6c; font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Handler h = &lt;span style=&quot;color: #88185d;&quot;&gt;new&lt;/span&gt; Handler();&lt;/div&gt;
&lt;div style=&quot;color: #6c6c6c; font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;h.postDelayed(&lt;span style=&quot;color: #88185d;&quot;&gt;this&lt;/span&gt;, &lt;span style=&quot;color: #0023c5;&quot;&gt;DELAY&lt;/span&gt;);&lt;/div&gt;
&lt;div style=&quot;color: #6c6c6c; font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #6c6c6c; font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/div&gt;
&lt;div style=&quot;color: #6c6c6c; font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #6c6c6c; font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #88185d;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #88185d;&quot;&gt;void&lt;/span&gt; run() {&lt;/div&gt;
&lt;div style=&quot;color: #6c6c6c; font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #6c6c6c; font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;startActivity(&lt;span style=&quot;color: #88185d;&quot;&gt;new&lt;/span&gt; Intent(&lt;span style=&quot;color: #88185d;&quot;&gt;this&lt;/span&gt;, Main.&lt;span style=&quot;color: #88185d;&quot;&gt;class&lt;/span&gt;));&lt;/div&gt;
&lt;div style=&quot;color: #6c6c6c; font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #6c6c6c; font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;finish();&lt;/div&gt;
&lt;div style=&quot;color: #6c6c6c; font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #6c6c6c; font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/div&gt;
&lt;div style=&quot;color: #6c6c6c; font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 15px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #6c6c6c; font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
}&lt;/div&gt;
&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #88185d; font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;O exemplo tem uma simples activity que mostra uma imagem na tela, Enquanto isso um handler foi criado, e o método postDelayd(Runnable,delayMillis) foi utilizado para agendar um java.lang.Runnable com atraso de 3 segundos.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #e69138;&quot;&gt;Importante:&lt;/span&gt; Configure a SpashScreen para a primeira activity da aplicação, que está configurada com a acão MAIN e categoria LAUNCHER no AndroidManifest.xml.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;Para melhorar o visual da sua aplicação, vamos retirar a barra de titulo da activity.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;No AndroidManifest.xml na tag&amp;nbsp;activity&amp;nbsp;insira o seguinte código:&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #312eff;&quot;&gt;&lt;span style=&quot;color: #881e87;&quot;&gt;android:theme&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #312eff;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #312eff;&quot;&gt;&quot;@android:style/Theme.Black.NoTitleBar&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;color: #448687; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: #008688;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;&lt;/span&gt;activity&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #881e87;&quot;&gt;android:name&lt;/span&gt;=&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;.Main&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #312eff; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #881e87;&quot;&gt;android:label&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&quot;@string/app_name&quot;&lt;/div&gt;
&lt;div style=&quot;color: #312eff; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #881e87;&quot;&gt;android:theme&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&quot;@android:style/Theme.Black.NoTitleBar&quot;&lt;span style=&quot;color: #008688;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #008688;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #448687;&quot;&gt;activity&lt;/span&gt;&lt;span style=&quot;color: #008688;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #008688;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;Faça o mesmo para a Activity SplashScreen.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;Rode a aplicação, e aí está a sua Splash Screen.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;Até mais !&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Times; font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #312eff;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theheadsman.blogspot.com/feeds/792751900564301675/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://theheadsman.blogspot.com/2012/05/tela-splash-screen.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5185910518697051325/posts/default/792751900564301675'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5185910518697051325/posts/default/792751900564301675'/><link rel='alternate' type='text/html' href='http://theheadsman.blogspot.com/2012/05/tela-splash-screen.html' title='Tela Splash Screen'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05559454207956023443</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIv0W3WQDPyI-VQAMOqLfPIgA2gmQXte3Uv_e3hY3Cby4Yd8QTfQTOPze1Ki-SK-8RUbMxG-6NzI17GhvjI9a9a6qCkd5DYtYASXv_Heho3LgahJktVWqgoaotmvr1GkkUgb5UbAGnC28g/s72-c/tela1.tiff" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5185910518697051325.post-414921371167608075</id><published>2012-05-10T14:20:00.001-07:00</published><updated>2012-05-10T20:25:00.454-07:00</updated><title type='text'>Criando a tela principal - Dashboard</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #6aa84f; font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: large;&quot;&gt;( Android )&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;No google I/O 2011 foram apresentadas diversas palestras sobre android, e o Google criou um aplicativo demonstrando algumas boas práticas no desenvolvimento de aplicação mobile para Android.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Essa aplicação se chama iosched e pode se encontrada no site http://code.google.com/p/iosched&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Uma das funcionalidades que essa aplicação demonstra é o padrão dashboard para a tela inicial, onde temos o menu da aplicação. Felizmente o Google liberou o código-fonte da classe DashboardLayout, que pode ser encontrada neste link:&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;http://iosched.googlecode.com/hg//android/src/com/google/android/apps/iosched/ui/widget/DashboardLayout.java&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: orange;&quot;&gt;Obs: É a mesma classe utilizada pelo google para criar a tela principal do app Google+ p/ Android&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: orange;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;É, eu sei. Essa url é ridiculamente grande. &amp;nbsp; A classe está escondida nas profundezas dos servidores do Google. &amp;nbsp;Rsrsrsrsrs&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Essa classe é um gerador de layout customizado que vai organizar as views - neste caso, botões - da tela principal em linhas e colunas.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Beleza, agora que você já baixou a classe DashboardLayout.java, vamos criar o projeto. Meu objetivo não é ensinar como usar o eclipse, então eu parto do pré-suposto que todos saibam criar um projeto Android no mesmo. &amp;nbsp; Pode dar o nome que preferir ao projeto.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Print &amp;nbsp;do projeto criado:&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEih2DPUY6XilJwFMxaZQFn7q-9rhyrivsQ2O7FeMI8qq2sTBCen2fsHLORCGZ3WGseymxeIbE6y5Xb8_K8YUQZQeP7mU0L8aMhylfQv4ua7e2ZZCoMmBXUwDLfR9c4Ivdt4BdvmoKUmv4cb/s1600/tela1.tiff&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;180&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEih2DPUY6XilJwFMxaZQFn7q-9rhyrivsQ2O7FeMI8qq2sTBCen2fsHLORCGZ3WGseymxeIbE6y5Xb8_K8YUQZQeP7mU0L8aMhylfQv4ua7e2ZZCoMmBXUwDLfR9c4Ivdt4BdvmoKUmv4cb/s320/tela1.tiff&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Vamos copiar essa classe para nosso projeto, inserindo-a no pacote com.google.android.apps.iosched.ui.widget &amp;nbsp;A única alteração que vamos fazer no código-fonte &amp;nbsp;é configurar o números de colunas para 2.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Para isso, encontre o seguinte trecho de código na classe DashboardLayout: &amp;nbsp; int cols = 1; &amp;nbsp;, altere o valor de cols para 2.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Print - pacote&amp;nbsp;com.google.android.apps.iosched.ui.widget &amp;nbsp;com a classe&amp;nbsp;DashboardLayout inserida:&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFRbO1iY-NpS5tLcfTaxWnJZRIIC0JPm-YglAAlxz4qCyY9o4OUHE6h0hvOxkIlOVu-AnUGrTG3H37rIclsqpqLuOMw942StD4FwKk7jFTQ2cp2-supjSuR3hletde7_iDETHVuSkonjd7/s1600/tela2.tiff&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;180&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFRbO1iY-NpS5tLcfTaxWnJZRIIC0JPm-YglAAlxz4qCyY9o4OUHE6h0hvOxkIlOVu-AnUGrTG3H37rIclsqpqLuOMw942StD4FwKk7jFTQ2cp2-supjSuR3hletde7_iDETHVuSkonjd7/s320/tela2.tiff&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;O próximo passo é customizar o arquivo /res/layout/main.xml para utilizar o DashboardLayout. Felizmente esse layout é mágico e vai fazer todo o trabalho pessado. Rsrsrsrsrs&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Podem fazer o download das imagens utilizadas no exemplo:&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;http://www.theheadsman.com.br/exemploblog.zip&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Segue o código:&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;color: #881e87; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: #008688;&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;span style=&quot;color: #448687;&quot;&gt;xml&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;version&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;1.0&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;encoding&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;utf-8&quot;&lt;/span&gt;&lt;span style=&quot;color: #008688;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #312eff; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: #008688;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #448687;&quot;&gt;LinearLayout&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #881e87;&quot;&gt;xmlns:android&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&quot;http://schemas.android.com/apk/res/android&quot;&lt;/div&gt;
&lt;div style=&quot;color: #881e87; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;android:layout_width&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #881e87; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;android:layout_height&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #881e87; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;android:background&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;@color/fundo&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #881e87; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;android:gravity&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;center&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #881e87; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;android:orientation&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;vertical&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #008688;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #312eff; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #008688;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #448687;&quot;&gt;include&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #881e87;&quot;&gt;layout&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&quot;@layout/include_header&quot;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #008688;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #448687; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #008688;&quot;&gt;&amp;lt;&lt;/span&gt;com.google.android.apps.iosched.ui.widget.DashboardLayout&lt;/div&gt;
&lt;div style=&quot;color: #881e87; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;android:layout_width&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #881e87; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;text-decoration: underline;&quot;&gt;android:layout_height&lt;/span&gt;&lt;span style=&quot;color: black; text-decoration: underline;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff; text-decoration: underline;&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #881e87; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;android:layout_weight&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;1&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #008688;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #008688;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #448687;&quot;&gt;Button&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #881e87;&quot;&gt;android:id&lt;/span&gt;=&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;@+id/bt1&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #881e87; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;android:layout_width&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #881e87; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;android:layout_height&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #881e87; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;android:background&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;@drawable/btn1&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #881e87; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;android:drawablePadding&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;10dp&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #008688;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #008688;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #448687;&quot;&gt;Button&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #881e87;&quot;&gt;android:id&lt;/span&gt;=&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;@+id/bt2&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #881e87; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;android:layout_width&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #881e87; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;android:layout_height&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #881e87; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;android:background&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;@drawable/btn2&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #881e87; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;android:drawablePadding&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;10dp&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #008688;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #008688;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #448687;&quot;&gt;Button&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #881e87;&quot;&gt;android:id&lt;/span&gt;=&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;@+id/bt3&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #881e87; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;android:layout_width&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #881e87; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;android:layout_height&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #881e87; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;android:background&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;@drawable/btn3&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #881e87; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;android:drawablePadding&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;10dp&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #008688;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #008688;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #448687;&quot;&gt;Button&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #881e87;&quot;&gt;android:id&lt;/span&gt;=&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;@+id/bt4&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #881e87; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;android:layout_width&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #881e87; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;android:layout_height&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #881e87; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;android:background&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;@drawable/btn4&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #881e87; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;android:drawablePadding&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #312eff;&quot;&gt;&quot;10dp&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #008688;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;color: #448687; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #008688;&quot;&gt;&amp;lt;/&lt;/span&gt;com.google.android.apps.iosched.ui.widget.DashboardLayout&lt;span style=&quot;color: #008688;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #312eff; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #008688;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #448687;&quot;&gt;include&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #881e87;&quot;&gt;layout&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&quot;@layout/include_footer&quot;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #008688;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #448687; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: #008688;&quot;&gt;&amp;lt;/&lt;/span&gt;LinearLayout&lt;span style=&quot;color: #008688;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #448687; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: #008688;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #448687; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: #008688;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;Note que quando criamos a tag do DashboardLayout utilizamos o nome completo da classe, pois ela é uma View customizada.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;com.google.android.apps.iosched.ui.widget.DashboardLayout&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;( Futuramente estarei falando de Views customizadas ).&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;Print do main.xml&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCTOlksodCchJYXcswrjkI7Ix8ffZ9f_LKwx18JBSfvACHgY0q3LUcgWdtbKQ620r7i2vGB9Yrz1ZCQpf6MVXctnZFV_CtXXeCvmbi9RB1aRZ11eqncE9zZT0sFcZW67GPyJX_dboveZcz/s1600/tela3.tiff&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;180&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCTOlksodCchJYXcswrjkI7Ix8ffZ9f_LKwx18JBSfvACHgY0q3LUcgWdtbKQ620r7i2vGB9Yrz1ZCQpf6MVXctnZFV_CtXXeCvmbi9RB1aRZ11eqncE9zZT0sFcZW67GPyJX_dboveZcz/s320/tela3.tiff&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;O Arquivo /res/layout/main.xml representa o menu principal com o dashboard e possui os quatros botões da aplicação. &amp;nbsp;Note que no meu layout eu incluir outros dois arquivos para criar o cabeçalho e o rodapé. (Fica a critério de vocês a forma como vão configurar os seus projetos)&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;É para fechar, vamos adicionar eventos aos botões.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;Voltado a classe principal do projeto, Main.java.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;O que precisamos implementar agora são os eventos dos botões. Para isso vamos alterar o código-fonte da classe Main conforme demonstrado a seguir.&amp;nbsp;( Que no meu caso está com o nome de&amp;nbsp;ExemploDashboard ).&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Monaco; font-size: 11px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Monaco; font-size: 11px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Monaco; font-size: 11px;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: #88185d;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #88185d;&quot;&gt;class&lt;/span&gt; ExemploDashboard &lt;span style=&quot;color: #88185d;&quot;&gt;extends&lt;/span&gt; Activity &lt;span style=&quot;color: #88185d;&quot;&gt;implements&lt;/span&gt; OnClickListener {&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #88185d;&quot;&gt;private&lt;/span&gt; Button &lt;span style=&quot;color: #0023c5;&quot;&gt;bt1&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #88185d;&quot;&gt;private&lt;/span&gt; Button &lt;span style=&quot;color: #0023c5;&quot;&gt;bt2&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #88185d;&quot;&gt;private&lt;/span&gt; Button &lt;span style=&quot;color: #0023c5;&quot;&gt;bt3&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #88185d;&quot;&gt;private&lt;/span&gt; Button &lt;span style=&quot;color: #0023c5;&quot;&gt;bt4&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #6c6c6c; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/span&gt;@Override&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #88185d;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #88185d;&quot;&gt;void&lt;/span&gt; onCreate(Bundle savedInstanceState) {&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color: #88185d;&quot;&gt;super&lt;/span&gt;.onCreate(savedInstanceState);&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;setContentView(&lt;span style=&quot;text-decoration: underline;&quot;&gt;R&lt;/span&gt;.layout.main);&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color: #0023c5;&quot;&gt;bt1&lt;/span&gt; = (Button) findViewById(&lt;span style=&quot;text-decoration: underline;&quot;&gt;R&lt;/span&gt;.id.bt1);&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color: #0023c5;&quot;&gt;bt1&lt;/span&gt;.setOnClickListener(&lt;span style=&quot;color: #88185d;&quot;&gt;this&lt;/span&gt;);&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color: #0023c5;&quot;&gt;bt2&lt;/span&gt; = (Button) findViewById(&lt;span style=&quot;text-decoration: underline;&quot;&gt;R&lt;/span&gt;.id.bt2);&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color: #0023c5;&quot;&gt;bt2&lt;/span&gt;.setOnClickListener(&lt;span style=&quot;color: #88185d;&quot;&gt;this&lt;/span&gt;);&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color: #0023c5;&quot;&gt;bt3&lt;/span&gt; = (Button) findViewById(&lt;span style=&quot;text-decoration: underline;&quot;&gt;R&lt;/span&gt;.id.bt3);&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color: #0023c5;&quot;&gt;bt3&lt;/span&gt;.setOnClickListener(&lt;span style=&quot;color: #88185d;&quot;&gt;this&lt;/span&gt;);&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color: #0023c5;&quot;&gt;bt4&lt;/span&gt; = (Button) findViewById(&lt;span style=&quot;text-decoration: underline;&quot;&gt;R&lt;/span&gt;.id.bt4);&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color: #0023c5;&quot;&gt;bt4&lt;/span&gt;.setOnClickListener(&lt;span style=&quot;color: #88185d;&quot;&gt;this&lt;/span&gt;);&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #88185d;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #88185d;&quot;&gt;void&lt;/span&gt; onClick(View v) {&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color: #88185d;&quot;&gt;if&lt;/span&gt; (v == &lt;span style=&quot;color: #0023c5;&quot;&gt;bt1&lt;/span&gt;) {&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #448567; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;/span&gt;/* &lt;span style=&quot;text-decoration: underline;&quot;&gt;Implemente&lt;/span&gt; &lt;span style=&quot;text-decoration: underline;&quot;&gt;você&lt;/span&gt; */&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;} &lt;span style=&quot;color: #88185d;&quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: #88185d;&quot;&gt;if&lt;/span&gt; (v == &lt;span style=&quot;color: #0023c5;&quot;&gt;bt2&lt;/span&gt;) {&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #448567; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;/span&gt;/* &lt;span style=&quot;text-decoration: underline;&quot;&gt;Implemente&lt;/span&gt; &lt;span style=&quot;text-decoration: underline;&quot;&gt;você&lt;/span&gt; */&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;} &lt;span style=&quot;color: #88185d;&quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: #88185d;&quot;&gt;if&lt;/span&gt; (v == &lt;span style=&quot;color: #0023c5;&quot;&gt;bt3&lt;/span&gt;) {&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #448567; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;/span&gt;/* &lt;span style=&quot;text-decoration: underline;&quot;&gt;Implemente&lt;/span&gt; &lt;span style=&quot;text-decoration: underline;&quot;&gt;você&lt;/span&gt; */&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;} &lt;span style=&quot;color: #88185d;&quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: #88185d;&quot;&gt;if&lt;/span&gt; (v == &lt;span style=&quot;color: #0023c5;&quot;&gt;bt4&lt;/span&gt;) {&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #448567; font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;/span&gt;/* &lt;span style=&quot;text-decoration: underline;&quot;&gt;Implemente&lt;/span&gt; &lt;span style=&quot;text-decoration: underline;&quot;&gt;você&lt;/span&gt; */&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 15.0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/div&gt;
&lt;div style=&quot;font: 11.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;&quot;&gt;
}&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #008688;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #008688;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #008688;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #008688;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;Por hoje é só pessoal !&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #008688;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font: normal normal normal 11px/normal Monaco; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #008688;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://theheadsman.blogspot.com/feeds/414921371167608075/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://theheadsman.blogspot.com/2012/05/criando-tela-principal-dashboard.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5185910518697051325/posts/default/414921371167608075'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5185910518697051325/posts/default/414921371167608075'/><link rel='alternate' type='text/html' href='http://theheadsman.blogspot.com/2012/05/criando-tela-principal-dashboard.html' title='Criando a tela principal - Dashboard'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05559454207956023443</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEih2DPUY6XilJwFMxaZQFn7q-9rhyrivsQ2O7FeMI8qq2sTBCen2fsHLORCGZ3WGseymxeIbE6y5Xb8_K8YUQZQeP7mU0L8aMhylfQv4ua7e2ZZCoMmBXUwDLfR9c4Ivdt4BdvmoKUmv4cb/s72-c/tela1.tiff" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5185910518697051325.post-428273714748657379</id><published>2012-05-07T19:42:00.000-07:00</published><updated>2012-05-07T19:52:21.163-07:00</updated><title type='text'>Lendo texto do Conteúdo Raw na pasta Resource.</title><content type='html'>&lt;span style=&quot;color: #6aa84f; font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: large;&quot;&gt;( Android )&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;É possível armazenar o conteúdo na pasta raw e fazer a leitura utilizando o método abaixo ...&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Primeiros passos:&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;1. Crie uma pasta raw em res/&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;2. Crie um arquivo de texto e salve na pasta res/raw, que você acabou de criar&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;3. Criar Método chamado readTextResource()&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;4. Utilize o código abaixo para ler os dados&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;StringBuffer strBuffer = new StringBuffer();&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; InputStream inputStream = null;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; try {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; inputStream = owner.getResources().openRawResource(resourceId);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; BufferedReader br = new BufferedReader(new InputStreamReader(inputStream));&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; String str = br.readLine();&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; while (str != null) {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; strBuffer.append(str);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; str = br.readLine();&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; } catch (IOException e) {&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; } finally {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; try {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; if (inputStream != null) {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; inputStream.close();&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; } catch (IOException e) { &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;5. Retorna o valor StringBuffer.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;6. Se você precisa de um formato html, você pode usar a classe util html&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Html.fromHtml (text);&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: orange; font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Exemplo completo do código&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;public class MinhaActivity extends Activity {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;private Spanned mText = null;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;private TextView mTextView;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;public void onCreate(Bundle savedInstanceState) { &amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; super.onCreate(savedInstanceState);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; setContentView(R.layout.main);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; mTextView = (TextView) findViewById(R.id.sampleText);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; if (mText == null) {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;// Passando o nome do arquivo como parametro utilizando a Class R e o contexto&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; String text = readTextResource(R.raw.meuarquivo, this);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; mText = Html.fromHtml(text);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; mTextView.setText(mText);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;}&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;public String readTextResource(int resourceId, Activity owner) {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; StringBuffer strBuffer = new StringBuffer(); &amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; InputStream inputStream = null;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; try {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; inputStream = owner.getResources().openRawResource(resourceId);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; BufferedReader br = new BufferedReader(new InputStreamReader(inputStream));&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; String str = br.readLine();&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; while (str != null) {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; strBuffer.append(str);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; str = br.readLine();&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; } catch (IOException e) {&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; } finally {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; try {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; if (inputStream != null) {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; inputStream.close();&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; } catch (IOException e) { &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; return strBuffer.toString();&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;}&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://theheadsman.blogspot.com/feeds/428273714748657379/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://theheadsman.blogspot.com/2012/05/lendo-texto-do-conteudo-raw-na-pasta.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5185910518697051325/posts/default/428273714748657379'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5185910518697051325/posts/default/428273714748657379'/><link rel='alternate' type='text/html' href='http://theheadsman.blogspot.com/2012/05/lendo-texto-do-conteudo-raw-na-pasta.html' title='Lendo texto do Conteúdo Raw na pasta Resource.'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05559454207956023443</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5185910518697051325.post-64327516545410271</id><published>2012-05-03T23:53:00.001-07:00</published><updated>2012-05-09T23:57:42.990-07:00</updated><title type='text'>Ciclo de vida de uma activity (atividade)</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;color: #6aa84f; font-size: large;&quot;&gt;&lt;span style=&quot;line-height: 14px;&quot;&gt;&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;(&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 14px;&quot;&gt;Android )&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 14px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 14px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;line-height: 14px;&quot;&gt;&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;É muito importante entender o ciclo de vida de uma activity. isto é, os possíveis estados em que ela se encontra, que podem ser: executando, temporariamente interrompida em segundo plano ou completamente destruida.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;line-height: 14px;&quot;&gt;&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;line-height: 14px;&quot;&gt;&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Existem vários métodos que podem ser implementados na activity para controlar o estado da aplicação.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;line-height: 14px;&quot;&gt;&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;line-height: 14px;&quot;&gt;&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Vou detalhar cada método do ciclo de vida da activity:&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;line-height: 14px;&quot;&gt;&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;line-height: 14px;&quot;&gt;&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;line-height: 14px;&quot;&gt;&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;onCreate(Bundle) &amp;nbsp;&lt;/b&gt;&amp;nbsp;O método onCreate(Bundle) é obrigatório e é chamado uma única vez. Nesse método deve-se criar uma &amp;nbsp; view e chamar o método setContentView(View) para exibir-la na tela. Logo depois que o método onCreate(Bundle) é finalizado, o método onStart() é chamado para iniciar o ciclo de vida visível da activity.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 14px;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; line-height: 14px;&quot;&gt;onStart() &amp;nbsp;&lt;/b&gt;&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; line-height: 14px;&quot;&gt;&amp;nbsp;O método onStart() é chamado quando a activity está ficando visível ao usuário e já tem uma view. Pode ser chamado depois dos métodos onCreate(Bundle) e onRestart(), dependendo do estado da aplicação. O próximo método depois do onStart() é sempre onResume().&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 14px;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; line-height: 14px;&quot;&gt;onRestart() &amp;nbsp;&lt;/b&gt;&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; line-height: 14px;&quot;&gt;O método onRestart() é chamado quando a activity foi parada temporariamente e está sendo iniciada outra vez. O método onResume() chama o método onStart() de forma automática.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 14px;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; line-height: 14px;&quot;&gt;onResume() &lt;/b&gt;&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; line-height: 14px;&quot;&gt;&amp;nbsp; &amp;nbsp;O método onResume() é chamado quando uma activity está no topo da pilha &quot;activity stack&quot;, e e dessa forma já está executando como a activity principal e pronta para interagir com o usuário. Podemos dizer que o método onResume() representa o estado de que a activity está executando. O método é chamado sempre depois do onStart().&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 14px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;line-height: 14px;&quot;&gt;&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;onPause()&lt;/b&gt; &amp;nbsp; Se algum evento ocorrer, como o celular entrar em modo de espera/dormir para ecomonizar energia ou &amp;nbsp;uma Intent está sendo processsada, a activity do topo da pilha que está executando pode ser temporariamente interrompida. Para isso o método onPause() é chamado para salvar o estado da aplicação, para que posteriormente &amp;nbsp;quando a activity voltar a executar, tudo possa ser recuperado, se necessário no método onResume().&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 14px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;line-height: 14px;&quot;&gt;&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;onStop() &lt;/b&gt;&amp;nbsp;O método onStop() é chamado quando a activity está sendo encerrada, é não está mais visível ao usuário, o que o que pode ocorrer quando outra activity é iniciada, por exemplo. Depois de parada a activity pode ser reiniciada se necessário. Caso isso ocorra, o método onResume() é chamado para reiniciar a activity. Caso a activity fique muito tempo parada em segundo plano e o sistema operacional do Android precise limpar os recursos para liberar memória , o método onDestroy() pode ser automáticamente chamado, para remover completamente a activity da pilha.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 14px;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; line-height: 14px;&quot;&gt;onDestroy()&lt;/b&gt;&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; line-height: 14px;&quot;&gt; &amp;nbsp; O método onDestroy literalmente encerra a execução de uma activity. O método onDestroy() pode ser chamado automaticamente pelo sistema operacional para liberar recursos ou pode se chamado pela aplicação pela método finish() da classe Activity. depois do método onDestroy() ter executado a activity é removida completamente &amp;nbsp;da pilha e seu processo no sistema operacional também é completamente encerrado.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;line-height: 14px;&quot;&gt;&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 11px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;line-height: 14px;&quot;&gt;&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 11px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkZPimAnlMRAR83OhEag-e2glfl-8BYwm7y06tBWRNxzug7gppUrD3hgPbux_vH_MQyayASHQoCC6S4RPM5NvQ76x3T51Z34uhb8IyS5q6vU0Htxsd97t78nuZ0JtbPjigyK4RdS3jMEp6/s1600/Arquivo-Escaneado-1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;301&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkZPimAnlMRAR83OhEag-e2glfl-8BYwm7y06tBWRNxzug7gppUrD3hgPbux_vH_MQyayASHQoCC6S4RPM5NvQ76x3T51Z34uhb8IyS5q6vU0Htxsd97t78nuZ0JtbPjigyK4RdS3jMEp6/s320/Arquivo-Escaneado-1.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theheadsman.blogspot.com/feeds/64327516545410271/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://theheadsman.blogspot.com/2012/05/lorem-ipsum-simplesmente-uma-simulacao.html#comment-form' title='3 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5185910518697051325/posts/default/64327516545410271'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5185910518697051325/posts/default/64327516545410271'/><link rel='alternate' type='text/html' href='http://theheadsman.blogspot.com/2012/05/lorem-ipsum-simplesmente-uma-simulacao.html' title='Ciclo de vida de uma activity (atividade)'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05559454207956023443</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkZPimAnlMRAR83OhEag-e2glfl-8BYwm7y06tBWRNxzug7gppUrD3hgPbux_vH_MQyayASHQoCC6S4RPM5NvQ76x3T51Z34uhb8IyS5q6vU0Htxsd97t78nuZ0JtbPjigyK4RdS3jMEp6/s72-c/Arquivo-Escaneado-1.jpg" height="72" width="72"/><thr:total>3</thr:total></entry></feed>