<?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-7545725017020566519</id><updated>2024-09-06T18:51:01.188-04:00</updated><title type='text'>Tech Talk - Java</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://techtalk-java.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7545725017020566519/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://techtalk-java.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Raghvendra Kamlesh</name><uri>http://www.blogger.com/profile/14452008368850267332</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>14</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7545725017020566519.post-3616542729909485534</id><published>2012-10-08T21:44:00.001-04:00</published><updated>2012-10-08T21:44:45.323-04:00</updated><title type='text'>Java Design Patterns: Singleton Design Pattern</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Java Design Patterns: Singleton Design Pattern&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;While searching on the net, I come across this good video tutorial, so posting it here. Not created by me.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;iframe allowfullscreen=&#39;allowfullscreen&#39; webkitallowfullscreen=&#39;webkitallowfullscreen&#39; mozallowfullscreen=&#39;mozallowfullscreen&#39; width=&#39;320&#39; height=&#39;266&#39; src=&#39;https://www.youtube.com/embed/ZUkrYOKFkMM?feature=player_embedded&#39; frameborder=&#39;0&#39;&gt;&lt;/iframe&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://techtalk-java.blogspot.com/feeds/3616542729909485534/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://techtalk-java.blogspot.com/2012/10/java-design-patterns-singleton-design.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7545725017020566519/posts/default/3616542729909485534'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7545725017020566519/posts/default/3616542729909485534'/><link rel='alternate' type='text/html' href='http://techtalk-java.blogspot.com/2012/10/java-design-patterns-singleton-design.html' title='Java Design Patterns: Singleton Design Pattern'/><author><name>Ragh</name><uri>http://www.blogger.com/profile/03006693350083407737</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-7545725017020566519.post-839426222293347337</id><published>2012-10-08T21:19:00.005-04:00</published><updated>2012-10-08T21:19:54.468-04:00</updated><title type='text'>JAVA Design Patterns: Difference between Builder, Factory, and Abstract Factory Patterns</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
JAVA Design Patterns: Difference between Builder, Factory, and Abstract Factory Patterns&lt;br /&gt;
&lt;br /&gt;
While searching on the net, I come across this good video tutorial, so posting it here. Not created by me.&lt;br /&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;object width=&quot;320&quot; height=&quot;266&quot; class=&quot;BLOGGER-youtube-video&quot; classid=&quot;clsid:D27CDB6E-AE6D-11cf-96B8-444553540000&quot; codebase=&quot;http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0&quot; data-thumbnail-src=&quot;http://2.gvt0.com/vi/S9p_mwz1dd4/0.jpg&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/S9p_mwz1dd4&amp;fs=1&amp;source=uds&quot; /&gt;&lt;param name=&quot;bgcolor&quot; value=&quot;#FFFFFF&quot; /&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot; /&gt;&lt;embed width=&quot;320&quot; height=&quot;266&quot;  src=&quot;http://www.youtube.com/v/S9p_mwz1dd4&amp;fs=1&amp;source=uds&quot; type=&quot;application/x-shockwave-flash&quot; allowfullscreen=&quot;true&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://techtalk-java.blogspot.com/feeds/839426222293347337/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://techtalk-java.blogspot.com/2012/10/java-design-patterns-difference-between.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7545725017020566519/posts/default/839426222293347337'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7545725017020566519/posts/default/839426222293347337'/><link rel='alternate' type='text/html' href='http://techtalk-java.blogspot.com/2012/10/java-design-patterns-difference-between.html' title='JAVA Design Patterns: Difference between Builder, Factory, and Abstract Factory Patterns'/><author><name>Ragh</name><uri>http://www.blogger.com/profile/03006693350083407737</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-7545725017020566519.post-4394615348520082455</id><published>2012-03-14T19:00:00.000-04:00</published><updated>2012-03-14T19:04:50.612-04:00</updated><title type='text'>Change the background, text color for custom list view on focus and click</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;Change the background, text color for custom list view on focus and click&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
In this tutorial we will see how to change the background color on the custom list item, how to change the text style of text view etc.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
We will use the same example which we have created in &quot;&lt;a href=&quot;http://techtalk-java.blogspot.com/2012/02/how-to-create-custom-list-view-in.html&quot; target=&quot;_blank&quot;&gt;&lt;b&gt;How to create custom list view in android application&lt;/b&gt;&lt;/a&gt;&quot; blog.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Once you done with the above custom list creation follow the below steps to achieve this -&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&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/AVvXsEieu7oD777JhQKPxGMrNlUUMhA8oSHPLNemo4OCjmV-QVJQiPhvrG8bo_sd6qSq8mBOTe8QXetizzAiML1E8O9gF4hp95JHITrLH_UJA_x6Vv-bQVLRKaMRa52uv-rARMt1WAcQ-Cbx5JIk/s1600/customlistbackground.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEieu7oD777JhQKPxGMrNlUUMhA8oSHPLNemo4OCjmV-QVJQiPhvrG8bo_sd6qSq8mBOTe8QXetizzAiML1E8O9gF4hp95JHITrLH_UJA_x6Vv-bQVLRKaMRa52uv-rARMt1WAcQ-Cbx5JIk/s400/customlistbackground.png&quot; width=&quot;240&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Create a highlight.png file and put that in drawable folder.&lt;/li&gt;
&lt;li&gt;Create the selector for list item background, text 1 color, and text2 color as shown below under the drawable folder -&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
listselector.xml -&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div style=&quot;background-color: #cccccc;&quot;&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&amp;lt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;selector&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;xmlns:android&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&quot;http://schemas.android.com/apk/res/android&quot;&amp;nbsp;&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;lt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;item&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;android:state_focused&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;&quot;true&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;android:drawable&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&quot;@drawable/highlight&quot;&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;/ &amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;lt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;item&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;android:state_pressed&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;&quot;true&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;android:drawable&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&quot;@drawable/highlight&quot;&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;/ &amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;lt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;item&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;android:state_selected&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;&quot;true&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;android:drawable&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&quot;@drawable/highlight&quot;&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;/ &amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&amp;lt; /&lt;/span&gt;selector&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;listitemline1_selector.xml -&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;







&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #cccccc;&quot;&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&amp;lt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;selector&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;xmlns:android&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&quot;http://schemas.android.com/apk/res/android&quot;&amp;nbsp;&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;lt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;item&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;android:state_focused&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;&quot;true&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;android:color&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;&quot;#0e0c0a&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;/ &amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;lt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;item&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;android:state_pressed&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;&quot;true&quot;&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;android:color&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;&quot;#0e0c0a&quot;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;/ &amp;nbsp;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;lt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;item&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;android:state_selected&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;&quot;true&quot;&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;android:color&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;&quot;#0e0c0a&quot;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;/ &amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;lt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;item&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;android:color&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;&quot;#b48f53&quot;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;/ &amp;nbsp;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&amp;lt; /&lt;/span&gt;selector&amp;nbsp;&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;listitemline2_selector.xml -&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;







&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #cccccc;&quot;&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&amp;lt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;selector&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;xmlns:android&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&quot;http://schemas.android.com/apk/res/android&quot;&amp;nbsp;&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;item&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;android:state_focused&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;&quot;true&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;android:color&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;&quot;#0e0c0a&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;item&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;android:state_pressed&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;&quot;true&quot;&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;android:color&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;&quot;#0e0c0a&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;item&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;android:state_selected&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;&quot;true&quot;&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;android:color&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;&quot;#0e0c0a&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;item&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;android:color&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;&quot;#725521&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;selector&lt;span class=&quot;s1&quot;&gt;&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Now we need to assign these selector to individual list item and text views created on the hybridlist.xml file as shown below -&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
hybridlist.xml -&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #cccccc;&quot;&gt;
&lt;div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&amp;lt; ?&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;xml&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;version&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;1.0&quot;&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;encoding&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;utf-8&quot;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;? &amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s5&quot;&gt;&amp;lt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s6&quot;&gt;LinearLayout&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;android:layout_width&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;android:layout_height&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;s7&quot;&gt;android:gravity&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&quot;center_vertical&quot;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;android:descendantFocusability&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;blocksDescendants&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;s7&quot;&gt;xmlns:android&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&quot;http://schemas.android.com/apk/res/android&quot;&amp;nbsp;&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s5&quot;&gt;&amp;lt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s6&quot;&gt;LinearLayout&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;s6&quot;&gt;android:layout_width&lt;/span&gt;&lt;span class=&quot;s8&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s9&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;android:layout_height&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;android:orientation&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;vertical&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;b&gt;&lt;span class=&quot;s3&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;s7&quot;&gt;android:background&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&quot;@drawable/listselector&quot;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;android:layout_weight&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;1&quot;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&amp;lt;&amp;nbsp;&lt;/span&gt;TextView&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;s7&quot;&gt;android:id&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&quot;@+id/text1&quot;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;android:layout_width&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;android:layout_height&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;android:textSize&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;15sp&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
android:textStyle&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;bold&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;b&gt;&lt;span class=&quot;s7&quot;&gt;android:textColor&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&quot;@drawable/listitemline1_selector&quot;&lt;/b&gt;&amp;nbsp;&lt;span class=&quot;s1&quot;&gt;/ &amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&amp;lt;&amp;nbsp;&lt;/span&gt;TextView&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;s7&quot;&gt;android:id&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&quot;@+id/text2&quot;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;android:layout_width&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;android:layout_height&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;android:textSize&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;11sp&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span class=&quot;s7&quot;&gt;android:textColor&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&quot;@drawable/listitemline2_selector&quot;&lt;/b&gt;&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;/ &amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&amp;lt; /&amp;nbsp;&lt;/span&gt;LinearLayout&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&amp;lt; /&amp;nbsp;&lt;/span&gt;LinearLayout&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Now run the application and you will see the same output as shown above. Same kind of selector you can apply to any view like Button, ImageView, Spinner etc.&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techtalk-java.blogspot.com/feeds/4394615348520082455/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://techtalk-java.blogspot.com/2012/03/change-background-text-color-form.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7545725017020566519/posts/default/4394615348520082455'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7545725017020566519/posts/default/4394615348520082455'/><link rel='alternate' type='text/html' href='http://techtalk-java.blogspot.com/2012/03/change-background-text-color-form.html' title='Change the background, text color for custom list view on focus and click'/><author><name>Raghvendra Kamlesh</name><uri>http://www.blogger.com/profile/14452008368850267332</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/AVvXsEieu7oD777JhQKPxGMrNlUUMhA8oSHPLNemo4OCjmV-QVJQiPhvrG8bo_sd6qSq8mBOTe8QXetizzAiML1E8O9gF4hp95JHITrLH_UJA_x6Vv-bQVLRKaMRa52uv-rARMt1WAcQ-Cbx5JIk/s72-c/customlistbackground.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7545725017020566519.post-5484605735161871790</id><published>2012-03-13T23:52:00.000-04:00</published><updated>2012-03-13T23:52:06.589-04:00</updated><title type='text'>Create your own customized spinner control with icon and text</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;How to create your own customized spinner control with icon and text&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
In this tutorial we will see how to create your own customized spinner view. In real life application, your UI designer will ask you to put some icon, with text having background etc. So to achieve this, you will need to create your own spinner view.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&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/AVvXsEhgZMg2Gh5JJwXtd_9hWXPEujARnABmhYPwkw63Y68PWLrwZEPxyka6BMYnfvsYZ2Wa5KucRB_N_opIBHQgiT4dE1uvg5wzvwCCkArpQuu6-B1G653sLDdggLnDoIqGnSzhm9N5-Q7lnmaO/s1600/customSpinner1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgZMg2Gh5JJwXtd_9hWXPEujARnABmhYPwkw63Y68PWLrwZEPxyka6BMYnfvsYZ2Wa5KucRB_N_opIBHQgiT4dE1uvg5wzvwCCkArpQuu6-B1G653sLDdggLnDoIqGnSzhm9N5-Q7lnmaO/s400/customSpinner1.png&quot; width=&quot;240&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&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;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxwCyPTjsneTS-UmCi5eFtWQHG8rjeqYTZnyi8Ar8njt55PrB0aYIiV-L_tZktdDo4UES3qkFex4p8tQUHx2f8EpNiiY4Cm0GRSujC-6Dcn-hSHlrVRlw1Aiso_5ZKjNhIcwgbA6OB5_NZ/s1600/customSpinner2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxwCyPTjsneTS-UmCi5eFtWQHG8rjeqYTZnyi8Ar8njt55PrB0aYIiV-L_tZktdDo4UES3qkFex4p8tQUHx2f8EpNiiY4Cm0GRSujC-6Dcn-hSHlrVRlw1Aiso_5ZKjNhIcwgbA6OB5_NZ/s400/customSpinner2.png&quot; width=&quot;240&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
To achieve this, you will need need to place some icons in your drawable folder - motorola.png, google.png, microsoft.png, apple.png, yahoo.png, samsung.png.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;First step to create an android project. I created with the &quot;CustomerSpinnerDemo&quot; and the package is &quot;com.customspinnerdemo&quot;.&lt;/li&gt;
&lt;li&gt;Copy the above mentioned images into res/drawable folder.&lt;/li&gt;
&lt;li&gt;Create the string.xml file with the below content -&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
string.xml&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #cccccc;&quot;&gt;
&lt;div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;lt;?xml&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;version&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;1.0&quot;&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;encoding&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;utf-8&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&amp;lt;&lt;/span&gt;resources&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;s1&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;string&lt;/span&gt; &lt;span class=&quot;s5&quot;&gt;name&lt;/span&gt;=&lt;span class=&quot;s4&quot;&gt;&quot;hello&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;CustomSpinner Demo&amp;lt;/&lt;span class=&quot;s1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;string&lt;/span&gt;&lt;/span&gt;&amp;gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;s1&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;string&lt;/span&gt; &lt;span class=&quot;s5&quot;&gt;name&lt;/span&gt;=&lt;span class=&quot;s4&quot;&gt;&quot;prompt&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;Choose your selection&amp;lt;/&lt;span class=&quot;s2&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;s1&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;string&lt;/span&gt; &lt;span class=&quot;s5&quot;&gt;name&lt;/span&gt;=&lt;span class=&quot;s4&quot;&gt;&quot;app_name&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;CustomSpinner Demo&amp;lt;/&lt;span class=&quot;s2&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;lt;&lt;/span&gt;drawable&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;white&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;s6&quot;&gt;ffffff&lt;/span&gt;&amp;lt;/drawable&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;lt;&lt;/span&gt;drawable&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;black&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;#000000&lt;/span&gt;&amp;lt;/drawable&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;lt;&lt;/span&gt;drawable&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;green&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;#347C2C&lt;/span&gt;&amp;lt;/drawable&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;lt;&lt;/span&gt;drawable&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;pink&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;#FF00FF&lt;/span&gt;&amp;lt;/drawable&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;lt;&lt;/span&gt;drawable&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;violet&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;#a020f0&lt;/span&gt;&amp;lt;/drawable&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;lt;&lt;/span&gt;drawable&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;grey&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;#778899&lt;/span&gt;&amp;lt;/drawable&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;lt;&lt;/span&gt;drawable&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;red&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;#C11B17&lt;/span&gt;&amp;lt;/drawable&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;lt;&lt;/span&gt;drawable&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;yellow&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;#FFFF8C&lt;/span&gt;&amp;lt;/drawable&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;lt;&lt;/span&gt;drawable&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;PowderBlue&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;#b0e0e6&lt;/span&gt;&amp;lt;/drawable&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;lt;&lt;/span&gt;drawable&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;brown&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;#2F1700&lt;/span&gt;&amp;lt;/drawable&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;lt;&lt;/span&gt;drawable&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;Hotpink&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;#7D2252&lt;/span&gt;&amp;lt;/drawable&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;s1&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;string&lt;/span&gt; &lt;span class=&quot;s5&quot;&gt;name&lt;/span&gt;=&lt;span class=&quot;s4&quot;&gt;&quot;select_Category&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;Select Category&amp;lt;/&lt;span class=&quot;s2&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;lt;&lt;/span&gt;drawable&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;darkgrey&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;#606060&lt;/span&gt;&amp;lt;/drawable&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&amp;lt;/resources&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Change the main.xml as follows -&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;background-color: #cccccc;&quot;&gt;
&lt;div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;lt;?xml&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;version&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;1.0&quot;&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;encoding&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;utf-8&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;LinearLayout&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;xmlns:android&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&quot;http://schemas.android.com/apk/res/android&quot;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;android:orientation&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;vertical&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;android:layout_width&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;android:layout_height&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&amp;lt;&lt;/span&gt;TextView&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;android:layout_width&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;android:layout_height&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;android:text&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&quot;@string/hello&quot;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;s1&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&amp;lt;&lt;/span&gt;Spinner&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;android:id&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&quot;@+id/spinner&quot;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;android:layout_width&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;android:layout_height&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;android:drawSelectorOnTop&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;true&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;android:prompt&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&quot;@string/prompt&quot;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;s1&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&amp;lt;/LinearLayout&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Create the row.xml as below under the layout folder -&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;background-color: #cccccc;&quot;&gt;
&lt;div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;lt;?xml&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;version&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;1.0&quot;&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;encoding&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;utf-8&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;RelativeLayout&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;xmlns:android&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&quot;http://schemas.android.com/apk/res/android&quot;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&lt;/span&gt;android:layout_width&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&lt;/span&gt;android:layout_height&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&lt;/span&gt;android:orientation&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;vertical&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&lt;/span&gt;android:padding&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;3dip&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&amp;gt;&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s6&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;s7&quot;&gt;ImageView&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;android:id&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&quot;@+id/image&quot;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;android:layout_width&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;android:layout_height&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;android:src&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&quot;@drawable/icon&quot;&lt;span class=&quot;s1&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;lt;&lt;/span&gt;TextView&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;android:layout_toRightOf&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;@+id/image&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;android:padding&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;3dip&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;android:layout_marginTop&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;2dip&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;android:textColor&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;@drawable/red&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;android:textStyle&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;bold&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;android:id&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&quot;@+id/company&quot;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;android:layout_marginLeft&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;5dip&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;android:layout_width&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;android:layout_height&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;lt;&lt;/span&gt;TextView&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;android:layout_toRightOf&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;@+id/image&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;android:padding&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;2dip&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;android:textColor&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&quot;@drawable/darkgrey&quot;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;android:layout_marginLeft&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;5dip&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p5&quot;&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;s5&quot;&gt;android:id&lt;/span&gt;=&lt;span class=&quot;s4&quot;&gt;&quot;@+id/sub&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;android:layout_below&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;@+id/company&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;android:layout_width&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;android:layout_height&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&amp;lt;/RelativeLayout&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Now need to change the main activity class as follows -&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;background-color: #cccccc;&quot;&gt;
&lt;div&gt;
&lt;div&gt;
package com.customspinnerdemo;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
import android.app.Activity;&lt;/div&gt;
&lt;div&gt;
import android.content.Context;&lt;/div&gt;
&lt;div&gt;
import android.os.Bundle;&lt;/div&gt;
&lt;div&gt;
import android.view.LayoutInflater;&lt;/div&gt;
&lt;div&gt;
import android.view.View;&lt;/div&gt;
&lt;div&gt;
import android.view.ViewGroup;&lt;/div&gt;
&lt;div&gt;
import android.widget.ArrayAdapter;&lt;/div&gt;
&lt;div&gt;
import android.widget.ImageView;&lt;/div&gt;
&lt;div&gt;
import android.widget.Spinner;&lt;/div&gt;
&lt;div&gt;
import android.widget.TextView;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
public class CustomSpinnerDemoActivity extends Activity {&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;String[] strings = {&quot;Motorola&quot;,&quot;Google&quot;,&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;Microsoft&quot;, &quot;Apple&quot;, &quot;Yahoo&quot;,&quot;Samsung&quot;};&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; String[] subs = {&quot;Mobile world&quot;,&quot;Google gives you everything&quot;,&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;Microsoft king of windows&quot;, &quot;Apple you will love it&quot;, &quot;Yahoo still strugling&quot;,&quot;Samsung good&quot;};&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; int arr_images[] = { R.drawable.motorola,&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;R.drawable.google, R.drawable.microsoft,&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;R.drawable.apple, R.drawable.yahoo, R.drawable.samsung};&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; @Override&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; public void onCreate(Bundle savedInstanceState) {&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; super.onCreate(savedInstanceState);&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; setContentView(R.layout.main);&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Spinner mySpinner = (Spinner)findViewById(R.id.spinner);&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mySpinner.setAdapter(new MyAdapter(CustomSpinnerDemoActivity.this, R.layout.row, strings));&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; public class MyAdapter extends ArrayAdapter&lt;string&gt;{&lt;/string&gt;&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public MyAdapter(Context context, int textViewResourceId, &amp;nbsp; String[] objects) {&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; super(context, textViewResourceId, objects);&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; @Override&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public View getDropDownView(int position, View convertView,ViewGroup parent) {&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return getCustomView(position, convertView, parent);&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; @Override&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public View getView(int position, View convertView, ViewGroup parent) {&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return getCustomView(position, convertView, parent);&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public View getCustomView(int position, View convertView, ViewGroup parent) {&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; LayoutInflater inflater=getLayoutInflater();&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; View row=inflater.inflate(R.layout.row, parent, false);&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; TextView label=(TextView)row.findViewById(R.id.company);&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; label.setText(strings[position]);&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; TextView sub=(TextView)row.findViewById(R.id.sub);&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sub.setText(subs[position]);&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ImageView icon=(ImageView)row.findViewById(R.id.image);&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; icon.setImageResource(arr_images[position]);&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return row;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div&gt;
}&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Run the application and you will see the customer spinner control. You &amp;nbsp;can also attach the selector to change the background color, change the text etc.&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techtalk-java.blogspot.com/feeds/5484605735161871790/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://techtalk-java.blogspot.com/2012/03/create-your-own-customized-spinner.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7545725017020566519/posts/default/5484605735161871790'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7545725017020566519/posts/default/5484605735161871790'/><link rel='alternate' type='text/html' href='http://techtalk-java.blogspot.com/2012/03/create-your-own-customized-spinner.html' title='Create your own customized spinner control with icon and text'/><author><name>Raghvendra Kamlesh</name><uri>http://www.blogger.com/profile/14452008368850267332</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/AVvXsEhgZMg2Gh5JJwXtd_9hWXPEujARnABmhYPwkw63Y68PWLrwZEPxyka6BMYnfvsYZ2Wa5KucRB_N_opIBHQgiT4dE1uvg5wzvwCCkArpQuu6-B1G653sLDdggLnDoIqGnSzhm9N5-Q7lnmaO/s72-c/customSpinner1.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7545725017020566519.post-5163210208875510048</id><published>2012-03-13T23:12:00.002-04:00</published><updated>2012-03-13T23:12:54.532-04:00</updated><title type='text'>How to add/manage menus in android application</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;How to add/manage menu in android application&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Menues are very important part of any android applications, creation and managing those menu is little tricky in android. I will cover creation and managing menues in two steps - (You will need to create new android project and put 3 different play.png, record.png, soundon.png and stop.png into drawable folder)&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Creating menu items&lt;/li&gt;
&lt;li&gt;Managing menu items&lt;/li&gt;
&lt;/ul&gt;
&lt;u&gt;&lt;b&gt;Creating Menu Items -&amp;nbsp;&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&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/AVvXsEjvZwpTeIh6fACay9Cpq5-qqqXoD5MBmqQP2DFS0YxnAncLeBG_6qe9SfYfMt7NxmIiu3zw8yXnbOFvn_aWoasp7jJUwVakrOrTYWasdRTRckjBYFsfxR0NrsjLo1ScC_gTrd7u0jTB3bfe/s1600/menuitem.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvZwpTeIh6fACay9Cpq5-qqqXoD5MBmqQP2DFS0YxnAncLeBG_6qe9SfYfMt7NxmIiu3zw8yXnbOFvn_aWoasp7jJUwVakrOrTYWasdRTRckjBYFsfxR0NrsjLo1ScC_gTrd7u0jTB3bfe/s400/menuitem.png&quot; width=&quot;240&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Creating the menu item is pretty simple. We need to override the &quot;onCreateOptionsMenu(Menu menu)&quot; method on your Activity class and need to add menues. Below is my activity class for your reference -&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;background-color: #cccccc;&quot;&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;package&lt;/span&gt; com.menuitem.test;&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 class=&quot;s1&quot;&gt;import&lt;/span&gt; android.app.Activity;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;import&lt;/span&gt; android.os.Bundle;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;import&lt;/span&gt; android.view.Menu;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;import&lt;/span&gt; android.view.MenuItem;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;import&lt;/span&gt; android.widget.Toast;&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 class=&quot;s1&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;class&lt;/span&gt; MenuItemTestActivity &lt;span class=&quot;s1&quot;&gt;extends&lt;/span&gt; Activity {&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;private&lt;span class=&quot;s2&quot;&gt; &lt;/span&gt;boolean&lt;span class=&quot;s2&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;isPlayStarted&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; = &lt;/span&gt;false&lt;span class=&quot;s2&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;/** Called when the activity is first created. */&lt;/div&gt;
&lt;div class=&quot;p5&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;@Override&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;s1&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;void&lt;/span&gt; onCreate(Bundle savedInstanceState) {&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;s1&quot;&gt;super&lt;/span&gt;.onCreate(savedInstanceState);&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; setContentView(R.layout.&lt;span class=&quot;s4&quot;&gt;main&lt;/span&gt;);&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;p5&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;@Override&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;s1&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;boolean&lt;/span&gt; onCreateOptionsMenu(Menu menu) {&lt;/div&gt;
&lt;div class=&quot;p6&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;// &lt;span class=&quot;s5&quot;&gt;TODO&lt;/span&gt; Auto-generated method stub&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;menu.add(1, 101, 1, &lt;span class=&quot;s6&quot;&gt;&quot;Play&quot;&lt;/span&gt;).setIcon(R.drawable.&lt;span class=&quot;s4&quot;&gt;play&lt;/span&gt;);&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;menu.add(1, 102, 2, &lt;span class=&quot;s6&quot;&gt;&quot;Record&quot;&lt;/span&gt;).setIcon(R.drawable.&lt;span class=&quot;s4&quot;&gt;record&lt;/span&gt;);&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;menu.add(1, 103, 3, &lt;span class=&quot;s6&quot;&gt;&quot;Sound&quot;&lt;/span&gt;).setIcon(R.drawable.&lt;span class=&quot;s4&quot;&gt;soundon&lt;/span&gt;);&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;super&lt;/span&gt;.onCreateOptionsMenu(menu);&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;p5&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;@Override&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;s1&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;boolean&lt;/span&gt; onOptionsItemSelected(MenuItem item) {&lt;/div&gt;
&lt;div class=&quot;p6&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;// &lt;span class=&quot;s5&quot;&gt;TODO&lt;/span&gt; Auto-generated method stub&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;switch&lt;/span&gt;(item.getItemId()) {&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;case&lt;/span&gt; 101:&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;Toast.makeText(getApplicationContext(), &lt;span class=&quot;s6&quot;&gt;&quot;Play clicked&quot;&lt;/span&gt;, Toast.&lt;span class=&quot;s4&quot;&gt;LENGTH_LONG&lt;/span&gt;).show();&lt;/div&gt;
&lt;div class=&quot;p7&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;isPlayStarted&lt;span class=&quot;s2&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;break&lt;/span&gt;;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;case&lt;/span&gt; 102:&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;Toast.makeText(getApplicationContext(), &lt;span class=&quot;s6&quot;&gt;&quot;Record clicked&quot;&lt;/span&gt;, Toast.&lt;span class=&quot;s4&quot;&gt;LENGTH_LONG&lt;/span&gt;).show();&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;break&lt;/span&gt;;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;case&lt;/span&gt; 103:&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;Toast.makeText(getApplicationContext(), &lt;span class=&quot;s6&quot;&gt;&quot;Sound clicked&quot;&lt;/span&gt;, Toast.&lt;span class=&quot;s4&quot;&gt;LENGTH_LONG&lt;/span&gt;).show();&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;break&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;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;super&lt;/span&gt;.onOptionsItemSelected(item);&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
}&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;u&gt;&lt;b&gt;Managing Menu Items -&lt;/b&gt;&lt;/u&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;u&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/u&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Managing menu items are nothing but enabling and disabling some of the menu options, or adding the icons depending on the selected one etc. In this, we will change the menu item&#39;s icon and title depending on some conditions. So there is &quot;onPrepareOptionsMenu&quot; method which is called once user click on menu button and before displaying the menues in UI, this method is called. So you can include the code to change the title, icon of the menu item in this method. Apart from that, you can also enable/disable the menu item. Please see all the methods available for MenuItem.&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
At the time of first call -&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&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/AVvXsEjHZP5XZwyQrG7IpXaPJmmrucBTx1vjkoWcRzu_TY8haAcU27nqP6Yiz5EmuY5uLHCNe6TQuxaok8teKDTgN1pOzgA3Gk0HmcZZm82skeBSzA45yK8cmiMvQ9_JU87mthgAzkmiJCICAG3D/s1600/menuitem1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHZP5XZwyQrG7IpXaPJmmrucBTx1vjkoWcRzu_TY8haAcU27nqP6Yiz5EmuY5uLHCNe6TQuxaok8teKDTgN1pOzgA3Gk0HmcZZm82skeBSzA45yK8cmiMvQ9_JU87mthgAzkmiJCICAG3D/s400/menuitem1.png&quot; width=&quot;240&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
After clicking on Play menu, and again press the menu button -&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&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/AVvXsEgxYuDrrJFVCBy_dJsRvIHkxKUjcufl3m4ADLZl0Hoq429XO8zR1SnmBEwQUgzPFOPKNplQlLq09Tk_nc4se_OCQmtRAVH6aS06_QtkfYt8yADiep0WAO5knAVqush8yI1uZy8UdRxHsiUl/s1600/menuitem2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxYuDrrJFVCBy_dJsRvIHkxKUjcufl3m4ADLZl0Hoq429XO8zR1SnmBEwQUgzPFOPKNplQlLq09Tk_nc4se_OCQmtRAVH6aS06_QtkfYt8yADiep0WAO5knAVqush8yI1uZy8UdRxHsiUl/s400/menuitem2.png&quot; width=&quot;240&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
My activity class will look like this -&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;background-color: #cccccc;&quot;&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;package&lt;/span&gt; com.menuitem.test;&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 class=&quot;s1&quot;&gt;import&lt;/span&gt; android.app.Activity;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;import&lt;/span&gt; android.os.Bundle;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;import&lt;/span&gt; android.view.Menu;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;import&lt;/span&gt; android.view.MenuItem;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;import&lt;/span&gt; android.widget.Toast;&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 class=&quot;s1&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;class&lt;/span&gt; MenuItemTestActivity &lt;span class=&quot;s1&quot;&gt;extends&lt;/span&gt; Activity {&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;private&lt;span class=&quot;s2&quot;&gt; &lt;/span&gt;boolean&lt;span class=&quot;s2&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;isPlayStarted&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; = &lt;/span&gt;false&lt;span class=&quot;s2&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;/** Called when the activity is first created. */&lt;/div&gt;
&lt;div class=&quot;p5&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;@Override&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;s1&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;void&lt;/span&gt; onCreate(Bundle savedInstanceState) {&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;s1&quot;&gt;super&lt;/span&gt;.onCreate(savedInstanceState);&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; setContentView(R.layout.&lt;span class=&quot;s3&quot;&gt;main&lt;/span&gt;);&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;p5&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;@Override&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;s1&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;boolean&lt;/span&gt; onCreateOptionsMenu(Menu menu) {&lt;/div&gt;
&lt;div class=&quot;p6&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;// &lt;span class=&quot;s4&quot;&gt;TODO&lt;/span&gt; Auto-generated method stub&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;menu.add(1, 101, 1, &lt;span class=&quot;s5&quot;&gt;&quot;Play&quot;&lt;/span&gt;).setIcon(R.drawable.&lt;span class=&quot;s3&quot;&gt;play&lt;/span&gt;);&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;menu.add(1, 102, 2, &lt;span class=&quot;s5&quot;&gt;&quot;Record&quot;&lt;/span&gt;).setIcon(R.drawable.&lt;span class=&quot;s3&quot;&gt;record&lt;/span&gt;);&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;menu.add(1, 103, 3, &lt;span class=&quot;s5&quot;&gt;&quot;Sound&quot;&lt;/span&gt;).setIcon(R.drawable.&lt;span class=&quot;s3&quot;&gt;soundon&lt;/span&gt;);&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;super&lt;/span&gt;.onCreateOptionsMenu(menu);&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;p5&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;@Override&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;s1&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;boolean&lt;/span&gt; onOptionsItemSelected(MenuItem item) {&lt;/div&gt;
&lt;div class=&quot;p6&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;// &lt;span class=&quot;s4&quot;&gt;TODO&lt;/span&gt; Auto-generated method stub&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;switch&lt;/span&gt;(item.getItemId()) {&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;case&lt;/span&gt; 101:&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;Toast.makeText(getApplicationContext(), &lt;span class=&quot;s5&quot;&gt;&quot;Play clicked&quot;&lt;/span&gt;, Toast.&lt;span class=&quot;s3&quot;&gt;LENGTH_LONG&lt;/span&gt;).show();&lt;/div&gt;
&lt;div class=&quot;p7&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; (&lt;/span&gt;isPlayStarted&lt;span class=&quot;s2&quot;&gt;) {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p7&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;isPlayStarted&lt;span class=&quot;s2&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;}&lt;span class=&quot;s1&quot;&gt;else&lt;/span&gt; {&lt;/div&gt;
&lt;div class=&quot;p7&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;isPlayStarted&lt;span class=&quot;s2&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;break&lt;/span&gt;;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;case&lt;/span&gt; 102:&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;Toast.makeText(getApplicationContext(), &lt;span class=&quot;s5&quot;&gt;&quot;Record clicked&quot;&lt;/span&gt;, Toast.&lt;span class=&quot;s3&quot;&gt;LENGTH_LONG&lt;/span&gt;).show();&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;break&lt;/span&gt;;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;case&lt;/span&gt; 103:&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;Toast.makeText(getApplicationContext(), &lt;span class=&quot;s5&quot;&gt;&quot;Sound clicked&quot;&lt;/span&gt;, Toast.&lt;span class=&quot;s3&quot;&gt;LENGTH_LONG&lt;/span&gt;).show();&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;break&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;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;super&lt;/span&gt;.onOptionsItemSelected(item);&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;p5&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;@Override&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;s1&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;boolean&lt;/span&gt; onPrepareOptionsMenu(Menu menu) {&lt;/div&gt;
&lt;div class=&quot;p6&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;// &lt;span class=&quot;s4&quot;&gt;TODO&lt;/span&gt; Auto-generated method stub&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;MenuItem item = menu.findItem(101);&lt;/div&gt;
&lt;div class=&quot;p7&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; (&lt;/span&gt;isPlayStarted&lt;span class=&quot;s2&quot;&gt;) {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;item.setTitle(&lt;span class=&quot;s5&quot;&gt;&quot;Stop&quot;&lt;/span&gt;).setIcon(R.drawable.&lt;span class=&quot;s3&quot;&gt;stop&lt;/span&gt;);&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;} &lt;span class=&quot;s1&quot;&gt;else&lt;/span&gt; {&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;item.setTitle(&lt;span class=&quot;s5&quot;&gt;&quot;Play&quot;&lt;/span&gt;).setIcon(R.drawable.&lt;span class=&quot;s3&quot;&gt;play&lt;/span&gt;);&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;}&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;super&lt;/span&gt;.onPrepareOptionsMenu(menu);&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
}&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
Run the application and you will see the same screens as mentioned above.&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techtalk-java.blogspot.com/feeds/5163210208875510048/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://techtalk-java.blogspot.com/2012/03/how-to-addmanage-menus-in-android.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7545725017020566519/posts/default/5163210208875510048'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7545725017020566519/posts/default/5163210208875510048'/><link rel='alternate' type='text/html' href='http://techtalk-java.blogspot.com/2012/03/how-to-addmanage-menus-in-android.html' title='How to add/manage menus in android application'/><author><name>Raghvendra Kamlesh</name><uri>http://www.blogger.com/profile/14452008368850267332</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/AVvXsEjvZwpTeIh6fACay9Cpq5-qqqXoD5MBmqQP2DFS0YxnAncLeBG_6qe9SfYfMt7NxmIiu3zw8yXnbOFvn_aWoasp7jJUwVakrOrTYWasdRTRckjBYFsfxR0NrsjLo1ScC_gTrd7u0jTB3bfe/s72-c/menuitem.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7545725017020566519.post-1229786295720213459</id><published>2012-02-08T23:10:00.000-05:00</published><updated>2012-03-14T19:05:10.546-04:00</updated><title type='text'>How to create custom list view in android application</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;How to create custom list view in android application&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
In this tutorial we will learn how to create custom list view, since the standart list view is having only one line which doesn&#39;t have facility to format as we want. So the solution here is to create your own custom list view.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Here I am creating a custom list view which will have Two lines to display the information. Also you can add as many controls you want easily to the each item in the list view.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;
After the run the custom list will be displayed like this -&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/AVvXsEjMvqSkTLbFDDkHjYAA31PuZ8UjNnRBffq1_Fq9SJINQUbZau7IMS7Rr6ztuaDCUm4hO7ZpQ0ol_JptelGsMQeViPuTnFKu9AqFR7iASZrcFR2OwemCSLT2SYgvDYd_eoLvAraI3r6wG6SL/s1600/customlist.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMvqSkTLbFDDkHjYAA31PuZ8UjNnRBffq1_Fq9SJINQUbZau7IMS7Rr6ztuaDCUm4hO7ZpQ0ol_JptelGsMQeViPuTnFKu9AqFR7iASZrcFR2OwemCSLT2SYgvDYd_eoLvAraI3r6wG6SL/s640/customlist.png&quot; width=&quot;387&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
To create the above custom list, need to follow below steps.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;First create new Android Project.&lt;/li&gt;
&lt;li&gt;First you need to create a simple pojo class which will be kind of data holder for your list item. In my case I took the example of Employe, below is my pojo class -&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;background-color: #cccccc;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;package com.test.customlistviewtest;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;import java.util.ArrayList;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;import java.util.List;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/**&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; * @author Raghvendra Kamlesh&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; *&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;*/&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public class Employe {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;private static List&lt;employe&gt; employeList = &amp;nbsp;new ArrayList&lt;employe&gt;();&lt;/employe&gt;&lt;/employe&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;private String name;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;private String department;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;public Employe(String name, String department) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;this.name = name;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;this.department = department;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public static List&lt;employe&gt; getEmployeList() {&lt;/employe&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;return employeList;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public String getName() {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;return name;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public void setName(String name) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;nbsp; &amp;nbsp; this.name = name;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public String getDepartment() {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;return department;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public void setDepartment(String department) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;nbsp; &amp;nbsp; this.department = department;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;}&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/div&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Create a new layout file which will be representation of the one item in the list. In my case I am using two text controls to create one item in the list. Here is my hybridlist.xml file which you need to create inside the layout folder.&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;background-color: #cccccc;&quot;&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt; ?&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;xml&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;version&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;1.0&quot;&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;encoding&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;utf-8&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt; &lt;/span&gt;LinearLayout&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;android:&lt;span class=&quot;s5&quot;&gt;layout_width&lt;/span&gt;=&lt;span class=&quot;s4&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;android:&lt;span class=&quot;s5&quot;&gt;layout_height&lt;/span&gt;=&lt;span class=&quot;s4&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;android:&lt;span class=&quot;s5&quot;&gt;gravity&lt;/span&gt;=&lt;span class=&quot;s4&quot;&gt;&quot;center_vertical&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;android:descendantFocusability&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;blocksDescendants&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;s5&quot;&gt;xmlns:android&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&quot;http://schemas.android.com/apk/res/android&quot;&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;s1&quot;&gt;&amp;lt; &lt;/span&gt;LinearLayout&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;android:&lt;span class=&quot;s5&quot;&gt;layout_width&lt;/span&gt;=&lt;span class=&quot;s4&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;android:&lt;span class=&quot;s5&quot;&gt;layout_height&lt;/span&gt;=&lt;span class=&quot;s4&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;android:&lt;span class=&quot;s5&quot;&gt;orientation&lt;/span&gt;=&lt;span class=&quot;s4&quot;&gt;&quot;vertical&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;android:&lt;span class=&quot;s5&quot;&gt;layout_weight&lt;/span&gt;=&lt;span class=&quot;s4&quot;&gt;&quot;1&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p5&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;lt; &lt;span class=&quot;s2&quot;&gt;TextView&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;android:&lt;span class=&quot;s5&quot;&gt;id&lt;/span&gt;=&lt;span class=&quot;s4&quot;&gt;&quot;@+id/text1&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;android:&lt;span class=&quot;s5&quot;&gt;layout_width&lt;/span&gt;=&lt;span class=&quot;s4&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;android:&lt;span class=&quot;s5&quot;&gt;layout_height&lt;/span&gt;=&lt;span class=&quot;s4&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;android:&lt;span class=&quot;s5&quot;&gt;textSize&lt;/span&gt;=&lt;span class=&quot;s4&quot;&gt;&quot;15sp&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;android:textStyle&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;bold&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;android:&lt;span class=&quot;s5&quot;&gt;text&lt;/span&gt;=&lt;span class=&quot;s4&quot;&gt;&quot;Text view 1&quot;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p5&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;lt; &lt;span class=&quot;s2&quot;&gt;TextView&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;android:&lt;span class=&quot;s5&quot;&gt;id&lt;/span&gt;=&lt;span class=&quot;s4&quot;&gt;&quot;@+id/text2&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;android:&lt;span class=&quot;s5&quot;&gt;layout_width&lt;/span&gt;=&lt;span class=&quot;s4&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;android:&lt;span class=&quot;s5&quot;&gt;layout_height&lt;/span&gt;=&lt;span class=&quot;s4&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;android:&lt;span class=&quot;s5&quot;&gt;textSize&lt;/span&gt;=&lt;span class=&quot;s4&quot;&gt;&quot;11sp&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;android:&lt;span class=&quot;s5&quot;&gt;text&lt;/span&gt;=&lt;span class=&quot;s4&quot;&gt;&quot;Text view 2&quot;&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p5&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt; /&lt;span class=&quot;s2&quot;&gt;LinearLayout&lt;/span&gt;&amp;gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt; /&lt;/span&gt;LinearLayout&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Now need to create a EmployeAdapter class which should extends from&amp;nbsp;
&lt;div class=&quot;p1&quot;&gt;
BaseAdapter, and need to provide the implementation of its abstract methods. This is the actual adapter class where we will provide our own view to the custom list.&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;background-color: #cccccc;&quot;&gt;
&lt;div class=&quot;p1&quot;&gt;
package com.test.customlistviewtest;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
import java.util.List;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
import android.content.Context;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
import android.view.LayoutInflater;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
import android.view.View;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
import android.view.ViewGroup;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
import android.widget.BaseAdapter;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
import android.widget.LinearLayout;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
import android.widget.TextView;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
/**&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp;* @author Raghvendra Kamlesh&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp;*&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp;*/&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
public class EmployeAdapter extends BaseAdapter {&lt;/div&gt;
&lt;div class=&quot;p1&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 class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private List&lt;employe&gt; employeList;&lt;/employe&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private Context context;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&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 class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; *&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;p1&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 class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public EmployeAdapter(Context context, List&lt;employe&gt; employeList) {&lt;/employe&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;this.context = context;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;this.employeList = employeList;&lt;/div&gt;
&lt;div class=&quot;p1&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 class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;/* (non-Javadoc)&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; * @see android.widget.Adapter#getCount()&lt;/div&gt;
&lt;div class=&quot;p1&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 class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public int getCount() {&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// TODO Auto-generated method stub&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;return employeList.size();&lt;/div&gt;
&lt;div class=&quot;p1&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 class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;/* (non-Javadoc)&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; * @see android.widget.Adapter#getItem(int)&lt;/div&gt;
&lt;div class=&quot;p1&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 class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public Object getItem(int position) {&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// TODO Auto-generated method stub&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;return employeList.get(position);&lt;/div&gt;
&lt;div class=&quot;p1&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 class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;/* (non-Javadoc)&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; * @see android.widget.Adapter#getItemId(int)&lt;/div&gt;
&lt;div class=&quot;p1&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 class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public long getItemId(int position) {&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// TODO Auto-generated method stub&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;return position;&lt;/div&gt;
&lt;div class=&quot;p1&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 class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;/* (non-Javadoc)&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; * @see android.widget.Adapter#getView(int, android.view.View, android.view.ViewGroup)&lt;/div&gt;
&lt;div class=&quot;p1&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 class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public View getView(int position, View convertView, ViewGroup parent) {&lt;/div&gt;
&lt;div class=&quot;p1&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 class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;Employe e = employeList.get(position);&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;convertView = (LinearLayout)LayoutInflater.from(context).inflate&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (R.layout.hybridlist, null);&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;TextView text1 = (TextView)convertView.findViewById(R.id.text1);&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;text1.setText(e.getName());&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;TextView text2 = (TextView) convertView.findViewById(R.id.text2);&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;text2.setText(e.getDepartment());&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;return convertView;&lt;/div&gt;
&lt;div class=&quot;p1&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 class=&quot;p1&quot;&gt;
}&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;Change the main.xml as below -&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;div style=&quot;background-color: #cccccc;&quot;&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt; ?&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;xml&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;version&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;1.0&quot;&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;encoding&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;utf-8&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt; &lt;/span&gt;LinearLayout&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:layout_width&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:layout_height&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:orientation&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;vertical&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;s5&quot;&gt;xmlns:android&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&quot;http://schemas.android.com/apk/res/android&quot;&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;s1&quot;&gt;&amp;lt; &lt;/span&gt;TextView&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:layout_width&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:layout_height&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:textSize&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;20sp&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:textStyle&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;bold&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:padding&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;5dp&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;s5&quot;&gt;android:text&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&quot;Custom List Example&quot;&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;s1&quot;&gt;&amp;lt; &lt;/span&gt;ListView&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;s5&quot;&gt;android:id&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&quot;@+id/lstEmploye&quot;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:layout_width&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:layout_height&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:padding&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;10dp&quot;&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt; /&lt;/span&gt;LinearLayout&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Now in main activity class, you will need to assign employe adapter to list view and then new employe adapter class will take care of displaying hybride.xml layout for each and every item in the list. Also you can capture the on select event, and identify which item user has selected.&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;background-color: #cccccc;&quot;&gt;
&lt;div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; package com.test.customlistviewtest;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;import android.app.Activity;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;import android.os.Bundle;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;import android.view.View;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;import android.widget.AdapterView;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;import android.widget.AdapterView.OnItemClickListener;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;import android.widget.ListView;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;import android.widget.Toast;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;public class CustomListViewTestActivity extends Activity {&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;ListView lstEmployeView;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;/** Called when the activity is first created. */&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; @Override&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;public void onCreate(Bundle savedInstanceState) {&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;super.onCreate(savedInstanceState);&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;setContentView(R.layout.main);&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;Employe.getEmployeList().add(new Employe(&quot;John leun&quot;, &quot;Engineering&quot;));&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;Employe.getEmployeList().add(new Employe(&quot;Meddy yu chan&quot;, &quot;Marketing&quot;));&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;Employe.getEmployeList().add(new Employe(&quot;David federal desulmati&quot;, &quot;Engineering&quot;));&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;Employe.getEmployeList().add(new Employe(&quot;Denny folkerl mo&quot;, &quot;Sales&quot;));&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;Employe.getEmployeList().add(new Employe(&quot;Daniel soln cary&quot;, &quot;Admin&quot;));&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;lstEmployeView = (ListView)findViewById(R.id.lstEmploye);&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;lstEmployeView.setAdapter(new EmployeAdapter(this, Employe.getEmployeList()));&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;lstEmployeView.setOnItemClickListener(new OnItemClickListener() {&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;public void onItemClick(AdapterView arg0, View arg1, int arg2, long arg3) {&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;Employe selectedEmploye = Employe.getEmployeList().get(arg2);&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;Toast.makeText(getApplicationContext(), &quot;Selected Employe is ==&amp;gt; &quot; + selectedEmploye.getName(), Toast.LENGTH_LONG).show();&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;});&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Now the example is completed, you can run the example and see the newly created custom list view. There are so many other possibility also can be achieve by writing our own custom layout for list view. We can add images, check boxes, radio buttons and many other controls inside the hybridlayout.xml file to include that for each and every list item.&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
If you want to do customization of the list item like changing the background color, text color on focus or on select see the &quot;&lt;a href=&quot;http://techtalk-java.blogspot.com/2012/03/change-background-text-color-form.html&quot; target=&quot;_blank&quot;&gt;&lt;b&gt;Change the background, text color for custom list view on focus and click&lt;/b&gt;&lt;/a&gt;&quot; post.&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techtalk-java.blogspot.com/feeds/1229786295720213459/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://techtalk-java.blogspot.com/2012/02/how-to-create-custom-list-view-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7545725017020566519/posts/default/1229786295720213459'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7545725017020566519/posts/default/1229786295720213459'/><link rel='alternate' type='text/html' href='http://techtalk-java.blogspot.com/2012/02/how-to-create-custom-list-view-in.html' title='How to create custom list view in android application'/><author><name>Raghvendra Kamlesh</name><uri>http://www.blogger.com/profile/14452008368850267332</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/AVvXsEjMvqSkTLbFDDkHjYAA31PuZ8UjNnRBffq1_Fq9SJINQUbZau7IMS7Rr6ztuaDCUm4hO7ZpQ0ol_JptelGsMQeViPuTnFKu9AqFR7iASZrcFR2OwemCSLT2SYgvDYd_eoLvAraI3r6wG6SL/s72-c/customlist.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7545725017020566519.post-7730690510635303472</id><published>2012-02-08T19:58:00.002-05:00</published><updated>2012-02-08T19:58:50.985-05:00</updated><title type='text'>How to create AutoComplete text view in Android Application</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;How to create AutoComplete text view in Android Application&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
In this tutorial, we will learn how to create Auto complete text view. In this example I am using hard corded value, in real world these value can be fetched from DB, RSS feed or from some other sources.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Create new Android project.&lt;/li&gt;
&lt;li&gt;Add autotext view layout in main.xml file as shown below -&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;div style=&quot;background-color: #cccccc;&quot;&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt; ?&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;xml&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;version&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;1.0&quot;&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;encoding&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;utf-8&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt; &lt;/span&gt;LinearLayout&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:id&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&quot;@+id/widget32&quot;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:layout_width&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:layout_height&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:orientation&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;vertical&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xmlns:android&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&quot;http://schemas.android.com/apk/res/android&quot;&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt; &lt;/span&gt;AutoCompleteTextView&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:id&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&quot;@+id/textAutoComplete&quot;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:layout_width&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:layout_height&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:padding&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;15dp&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:layout_marginLeft&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;20dp&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:text&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s3&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:textSize&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;18sp&quot;&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt; /&lt;/span&gt;LinearLayout&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Now need to attach the adapter to this auto complete view in activity class. I am using hard coded string array for demo purpose -&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;div style=&quot;background-color: #cccccc;&quot;&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;package com.test.autocompletetest;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;import android.app.Activity;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;import android.os.Bundle;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;import android.widget.ArrayAdapter;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;import android.widget.AutoCompleteTextView;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public class AutoCompleteTest extends Activity {&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private String[] sports = { &quot;Cricket&quot;, &quot;Football&quot;, &quot;Table tenis&quot;, &quot;Hockey&quot;, &quot;Others&quot; };&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; AutoCompleteTextView acTextView;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /** Called when the activity is first created. */&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;@Override&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public void onCreate(Bundle savedInstanceState) {&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;super.onCreate(savedInstanceState);&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;setContentView(R.layout.main);&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ArrayAdapter&lt;string&gt; adapter =&amp;nbsp;&lt;/string&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;new ArrayAdapter&lt;string&gt;&lt;/string&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(this,android.R.layout.simple_dropdown_item_1line, sports);&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;acTextView = (AutoCompleteTextView)findViewById(R.id.&lt;span class=&quot;s1&quot;&gt;textAutoComplete&lt;/span&gt;);&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//Assigning the threshold value for auto complete view, so here once&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //user type one character then all the items from the adapter matching&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //that character will be displayed.&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;acTextView.setThreshold(1);&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//Assigning the adapter to auto complete view.&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;acTextView.setAdapter(adapter);&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Run the application and you will see the auto complete text view will be populated with matching to your first character which you type.&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techtalk-java.blogspot.com/feeds/7730690510635303472/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://techtalk-java.blogspot.com/2012/02/how-to-create-autocomplete-text-view-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7545725017020566519/posts/default/7730690510635303472'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7545725017020566519/posts/default/7730690510635303472'/><link rel='alternate' type='text/html' href='http://techtalk-java.blogspot.com/2012/02/how-to-create-autocomplete-text-view-in.html' title='How to create AutoComplete text view in Android Application'/><author><name>Raghvendra Kamlesh</name><uri>http://www.blogger.com/profile/14452008368850267332</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-7545725017020566519.post-7152529963425949925</id><published>2012-02-08T19:22:00.000-05:00</published><updated>2012-02-08T19:22:07.764-05:00</updated><title type='text'>How to create tabs in android application</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;How to create Tabs in android application&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
In this tutorial we will learn how to create tabs in android application and setting the height of the tabs.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Application will looks like this -&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&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/AVvXsEiYdn7nDhfOQpWvg_lsPN01shmVFDwiNMgjPAnVtd2AiI18UMUZUMoqY4q9fmu3YLD7a8lOEY08LSL_1HzDdxUkiOswORkcz2pvIVtGr9wH2iVfUttf5fyt_J7QL6fQ_6QPFcxjs3H6CcM_/s1600/tabtest.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYdn7nDhfOQpWvg_lsPN01shmVFDwiNMgjPAnVtd2AiI18UMUZUMoqY4q9fmu3YLD7a8lOEY08LSL_1HzDdxUkiOswORkcz2pvIVtGr9wH2iVfUttf5fyt_J7QL6fQ_6QPFcxjs3H6CcM_/s400/tabtest.png&quot; width=&quot;273&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Create a new android project.&lt;/li&gt;
&lt;li&gt;Create 3 different layout and 3 different activity as given below -&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Layouts -&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; tab1_layout.xml&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;background-color: #cccccc;&quot;&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt; ?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt; LinearLayout&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:orientation=&quot;vertical&quot;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:layout_width=&quot;fill_parent&quot;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:layout_height=&quot;fill_parent&quot; &amp;gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;lt; TextView android:text=&quot;Tab 1&quot;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;android:padding=&quot;15dip&quot;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:textSize=&quot;18dip&quot;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:layout_width=&quot;fill_parent&quot;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:layout_height=&quot;wrap_content&quot; /&amp;gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt; /LinearLayout&amp;gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; tab2_layout.xml&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #cccccc;&quot;&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;lt; ?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt; LinearLayout&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;android:orientation=&quot;vertical&quot;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;android:layout_width=&quot;fill_parent&quot;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;android:layout_height=&quot;fill_parent&quot;&amp;gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt; TextView android:text=&quot;Tab 2&quot;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:padding=&quot;15dip&quot;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:textSize=&quot;18dip&quot;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:layout_width=&quot;fill_parent&quot;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:layout_height=&quot;wrap_content&quot;/&amp;gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt; /LinearLayout&amp;gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; tab3_layout.xml&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div style=&quot;background-color: #cccccc;&quot;&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt; ?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt; LinearLayout&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:orientation=&quot;vertical&quot;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:layout_width=&quot;fill_parent&quot;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:layout_height=&quot;fill_parent&quot;&amp;gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;lt; TextView android:text=&quot;Tab 3&quot;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:padding=&quot;15dip&quot;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:textSize=&quot;18dip&quot;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:layout_width=&quot;fill_parent&quot;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:layout_height=&quot;wrap_content&quot;/&amp;gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt; /LinearLayout&amp;gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Activity Classes -&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Tab1.java&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #cccccc;&quot;&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;package com.test.tabtest;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; import android.app.Activity;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; import android.os.Bundle;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public class Tab1 extends Activity {&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public void onCreate(Bundle savedInstanceState) {&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; super.onCreate(savedInstanceState);&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; setContentView(R.layout.tab1_layout);&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; Tab2.java&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #cccccc;&quot;&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; package com.test.tabtest;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; import android.app.Activity;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; import android.os.Bundle;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public class Tab2 extends Activity {&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public void onCreate(Bundle savedInstanceState) {&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; super.onCreate(savedInstanceState);&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; setContentView(R.layout.tab2_layout);&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; Tab3.java&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #cccccc;&quot;&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;package com.test.tabtest;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; import android.app.Activity;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; import android.os.Bundle;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public class Tab3 extends Activity {&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public void onCreate(Bundle savedInstanceState) {&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; super.onCreate(savedInstanceState);&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; setContentView(R.layout.tab3_layout);&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Now create the main layout and main activity class which will extends from TabActivity as shown below -&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Layout main.xml -&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div style=&quot;background-color: #cccccc;&quot;&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt; ?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt; LinearLayout&amp;nbsp; xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:orientation=&quot;vertical&quot;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:layout_width=&quot;fill_parent&quot;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:layout_height=&quot;fill_parent&quot;&amp;gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt; TextView android:text=&quot;This is tab test!!!&quot;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;android:padding=&quot;15dip&quot;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;android:textSize=&quot;18dip&quot;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;android:layout_width=&quot;fill_parent&quot;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;android:layout_height=&quot;wrap_content&quot;/&amp;gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt; TabHost&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;android:id=&quot;@android:id/tabhost&quot;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;android:layout_width=&quot;fill_parent&quot;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;android:layout_height=&quot;fill_parent&quot;&amp;gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt; LinearLayout&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:orientation=&quot;vertical&quot;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:layout_width=&quot;fill_parent&quot;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:layout_height=&quot;fill_parent&quot;&amp;gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt; TabWidget&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;android:id=&quot;@android:id/tabs&quot;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;android:layout_width=&quot;fill_parent&quot;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;android:layout_height=&quot;wrap_content&quot; /&amp;gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt; FrameLayout&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;android:id=&quot;@android:id/tabcontent&quot;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:layout_width=&quot;fill_parent&quot;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:layout_height=&quot;fill_parent&quot;/&amp;gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;lt; /LinearLayout&amp;gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot;&gt;&lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt; /TabHost&amp;gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt; /LinearLayout&amp;gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
TabTest.java - main activity class -&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #cccccc;&quot;&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; package com.test.tabtest;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;import android.app.TabActivity;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;import android.content.Intent;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;import android.os.Bundle;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;import android.widget.TabHost;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;import android.widget.TabHost.TabSpec;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;public class TabTest extends TabActivity {&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/** Called when the activity is first created. */&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;@Override&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;public void onCreate(Bundle savedInstanceState) {&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;super.onCreate(savedInstanceState);&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;setContentView(R.layout.main);&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;TabHost tabHost = getTabHost(); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;TabSpec tab1spec = tabHost.newTabSpec(&quot;Tab1&quot;);&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;tab1spec.setIndicator(&quot;Tab1&quot;);&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Intent tab1Intent = new Intent(this, Tab1.class);&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;tab1spec.setContent(tab1Intent);&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;TabSpec tab2spec = tabHost.newTabSpec(&quot;Tab2&quot;);&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;tab2spec.setIndicator(&quot;Tab2&quot;);&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;Intent tab2Intent = new Intent(this, Tab2.class);&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;tab2spec.setContent(tab2Intent);&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;TabSpec tab3spec = tabHost.newTabSpec(&quot;Tab3&quot;);&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; tab3spec.setIndicator(&quot;Tab3&quot;);&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;Intent tab3Intent = new Intent(this, Tab3.class);&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;tab3spec.setContent(tab3Intent);&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;// Adding all TabSpec to TabHost&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;tabHost.addTab(tab1spec);&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;tabHost.addTab(tab2spec);&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;tabHost.addTab(tab3spec);&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//Adjusting the tab height as per need.&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;tabHost.getTabWidget().getChildAt(0).getLayoutParams().height=40;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;tabHost.getTabWidget().getChildAt(1).getLayoutParams().height=40;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;tabHost.getTabWidget().getChildAt(2).getLayoutParams().height=40;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Add entries in AndroidManifest.xml file for 3 new tab activities as shown below -&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;div style=&quot;background-color: #cccccc;&quot;&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt; ?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt; manifest xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;package=&quot;com.test.tabtest&quot;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;android:versionCode=&quot;1&quot;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;android:versionName=&quot;1.0&quot;&amp;gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;lt; application android:icon=&quot;@drawable/icon&quot; android:label=&quot;@string/app_name&quot;&amp;gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt; activity android:name=&quot;.TabTest&quot;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:label=&quot;@string/app_name&quot;&amp;gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;lt; intent-filter&amp;gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt; action android:name=&quot;android.intent.action.MAIN&quot; /&amp;gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt; category android:name=&quot;android.intent.category.LAUNCHER&quot; /&amp;gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt; /intent-filter&amp;gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;lt; /activity&amp;gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;i&gt;&lt;b&gt;&amp;lt; activity android:name=&quot;.Tab1&quot; /&amp;gt;&lt;/b&gt;&lt;/i&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;i&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt; activity android:name=&quot;.Tab2&quot; /&amp;gt;&lt;/b&gt;&lt;/i&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;i&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt; activity android:name=&quot;.Tab3&quot; /&amp;gt;&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;lt; /application&amp;gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt; /manifest&amp;gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Run the application and you will see the application having 3 different tabs and you can also put images for each tab by using below syntax -&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Instead of&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #cccccc;&quot;&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;tab1spec.setIndicator(&quot;Tab1&quot;);&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Use&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;background-color: #cccccc;&quot;&gt;
&lt;div&gt;
&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;tab1spec.setIndicator(&quot;Tab1&quot;, getResources().getDrawable(R.drawable.icon));&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techtalk-java.blogspot.com/feeds/7152529963425949925/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://techtalk-java.blogspot.com/2012/02/how-to-create-tabs-in-android.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7545725017020566519/posts/default/7152529963425949925'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7545725017020566519/posts/default/7152529963425949925'/><link rel='alternate' type='text/html' href='http://techtalk-java.blogspot.com/2012/02/how-to-create-tabs-in-android.html' title='How to create tabs in android application'/><author><name>Raghvendra Kamlesh</name><uri>http://www.blogger.com/profile/14452008368850267332</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/AVvXsEiYdn7nDhfOQpWvg_lsPN01shmVFDwiNMgjPAnVtd2AiI18UMUZUMoqY4q9fmu3YLD7a8lOEY08LSL_1HzDdxUkiOswORkcz2pvIVtGr9wH2iVfUttf5fyt_J7QL6fQ_6QPFcxjs3H6CcM_/s72-c/tabtest.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7545725017020566519.post-1394606072076122959</id><published>2012-02-08T18:22:00.001-05:00</published><updated>2012-02-08T18:26:26.043-05:00</updated><title type='text'>How to zoom and drag images in Android app</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;How to zoom and drag images in Android app&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
This tutorial will teach you, how to create android application with image zoom and scroll facility.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
First create the android project and follow the below steps. I used Android 1.6 for creating this example.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Add one image file in drawable folder with named &quot;tempimage&quot;.&lt;/li&gt;
&lt;li&gt;Create the main.xml with following configuration -&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;div style=&quot;background-color: #cccccc;&quot;&gt;
&lt;div class=&quot;p1&quot; style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span class=&quot;s1&quot;&gt;&lt;!--?&lt;/span--&gt;&lt;span class=&quot;s2&quot;&gt;xml&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;version&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;1.0&quot;&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;encoding&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;utf-8&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span class=&quot;s1&quot;&gt;&amp;lt;&lt;/span&gt;FrameLayout&lt;span class=&quot;s3&quot;&gt; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;xmlns:android&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&quot;http://schemas.android.com/apk/res/android&quot;&lt;span class=&quot;s3&quot;&gt; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;android:id&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&quot;@+id/root&quot;&lt;span class=&quot;s3&quot;&gt; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot; style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;android:layout_width&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot; style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;android:layout_height&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p4&quot; style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot; style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;ImageView&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt; &lt;/span&gt;android:id&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;@+id/imageview&quot;&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot; style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;android:layout_width&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot; style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;android:layout_height&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot; style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;android:src&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&quot;@drawable/tempimage&quot;&lt;span class=&quot;s3&quot;&gt; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot; style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;android:scaleType&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;matrix&quot;&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot; style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;android:adjustViewBounds&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;true&quot;&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot; style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;android:layout_gravity&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;center&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&lt;!--&lt;/span--&gt;ImageView&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p4&quot; style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot; style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span class=&quot;s1&quot;&gt;&lt;!--&lt;/span--&gt;FrameLayout&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Create the onlick listener as given below -&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;background-color: #cccccc;&quot;&gt;
&lt;div&gt;
&lt;div&gt;

package com.test.image.zoomtest;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
import android.graphics.Matrix; &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
import android.graphics.PointF; &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
import android.util.FloatMath; &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
import android.view.MotionEvent; &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
import android.view.View; &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
import android.view.View.OnTouchListener; &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
import android.widget.ImageView; &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
public class Touch implements OnTouchListener { &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;// These matrices will be used to move and zoom image &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;Matrix matrix = new Matrix(); &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;Matrix savedMatrix = new Matrix(); &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;// We can be in one of these 3 states &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;static final int NONE = 0; &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;static final int DRAG = 1; &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;static final int ZOOM = 2; &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;int mode = NONE; &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;// Remember some things for zooming &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;PointF start = new PointF(); &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;PointF mid = new PointF(); &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;float oldDist = 1f; &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;@Override &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;public boolean onTouch(View v, MotionEvent event) { &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; ImageView view = (ImageView) v; &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; // Dump touch event to log &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; dumpEvent(event); &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; // Handle touch events here... &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; switch (event.getAction() &amp;amp; MotionEvent.ACTION_MASK) { &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; case MotionEvent.ACTION_DOWN: &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;savedMatrix.set(matrix); &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;start.set(event.getX(), event.getY()); &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;mode = DRAG; &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;break; &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; case MotionEvent.ACTION_POINTER_DOWN: &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;oldDist = spacing(event); &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;if (oldDist &amp;gt; 10f) { &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; savedMatrix.set(matrix); &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; midPoint(mid, event); &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; mode = ZOOM; &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;} &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;break; &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; case MotionEvent.ACTION_UP: &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; case MotionEvent.ACTION_POINTER_UP: &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;mode = NONE; &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;break; &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; case MotionEvent.ACTION_MOVE: &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;if (mode == DRAG) { &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; // ... &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; matrix.set(savedMatrix); &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; matrix.postTranslate(event.getX() - start.x, event.getY() - start.y); &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;} else if (mode == ZOOM) { &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; float newDist = spacing(event); &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; if (newDist &amp;gt; 10f) { &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;matrix.set(savedMatrix); &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;float scale = newDist / oldDist; &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;matrix.postScale(scale, scale, mid.x, mid.y); &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; } &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;} &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;break; &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; } &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; view.setImageMatrix(matrix); &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; return true; // indicate event was handled &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;} &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;/** Show an event in the LogCat view, for debugging */ &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;private void dumpEvent(MotionEvent event) { &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; String names[] = { &quot;DOWN&quot;, &quot;UP&quot;, &quot;MOVE&quot;, &quot;CANCEL&quot;, &quot;OUTSIDE&quot;, &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &quot;POINTER_DOWN&quot;, &quot;POINTER_UP&quot;, &quot;7?&quot;, &quot;8?&quot;, &quot;9?&quot; }; &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; StringBuilder sb = new StringBuilder(); &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; int action = event.getAction(); &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; int actionCode = action &amp;amp; MotionEvent.ACTION_MASK; &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; sb.append(&quot;event ACTION_&quot;).append(names[actionCode]); &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; if (actionCode == MotionEvent.ACTION_POINTER_DOWN &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; || actionCode == MotionEvent.ACTION_POINTER_UP) { &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;sb.append(&quot;(pid &quot;).append( &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;action &amp;gt;&amp;gt; MotionEvent.ACTION_POINTER_ID_SHIFT); &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;sb.append(&quot;)&quot;); &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; } &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; sb.append(&quot;[&quot;); &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; for (int i = 0; i &amp;lt; event.getPointerCount(); i++) { &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;sb.append(&quot;#&quot;).append(i); &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;sb.append(&quot;(pid &quot;).append(event.getPointerId(i)); &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;sb.append(&quot;)=&quot;).append((int) event.getX(i)); &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;sb.append(&quot;,&quot;).append((int) event.getY(i)); &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;if (i + 1 &amp;lt; event.getPointerCount()) &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; sb.append(&quot;;&quot;); &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; } &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; sb.append(&quot;]&quot;); &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;} &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;/** Determine the space between the first two fingers */ &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;private float spacing(MotionEvent event) { &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; float x = event.getX(0) - event.getX(1); &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; float y = event.getY(0) - event.getY(1); &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; return FloatMath.sqrt(x * x + y * y); &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;} &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;/** Calculate the mid point of the first two fingers */ &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;private void midPoint(PointF point, MotionEvent event) { &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; float x = event.getX(0) + event.getX(1); &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; float y = event.getY(0) + event.getY(1); &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; point.set(x / 2, y / 2); &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;} &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
} &amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Set the image view ontouch listener as given below -&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;div style=&quot;background-color: #cccccc;&quot;&gt;
&lt;div&gt;
package com.test.image.zoomtest;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
import android.app.Activity;&lt;/div&gt;
&lt;div&gt;
import android.os.Bundle;&lt;/div&gt;
&lt;div&gt;
import android.widget.ImageView;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
public class ImageZoomTestActivity extends Activity {&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; /** Called when the activity is first created. */&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; @Override&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; public void onCreate(Bundle savedInstanceState) {&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; super.onCreate(savedInstanceState);&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; setContentView(R.layout.main);&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ImageView iv = (ImageView) findViewById(R.id.iv);&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; iv.setOnTouchListener(new Touch());&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div&gt;
}&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Now you are ready to run the application.&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techtalk-java.blogspot.com/feeds/1394606072076122959/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://techtalk-java.blogspot.com/2012/02/how-to-zoom-and-drag-images-in-android.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7545725017020566519/posts/default/1394606072076122959'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7545725017020566519/posts/default/1394606072076122959'/><link rel='alternate' type='text/html' href='http://techtalk-java.blogspot.com/2012/02/how-to-zoom-and-drag-images-in-android.html' title='How to zoom and drag images in Android app'/><author><name>Raghvendra Kamlesh</name><uri>http://www.blogger.com/profile/14452008368850267332</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>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7545725017020566519.post-1442435595259552292</id><published>2012-01-18T21:06:00.000-05:00</published><updated>2012-01-18T21:06:26.134-05:00</updated><title type='text'>How to implement Voice Recognition in android application</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;u&gt;How to implement Voice&amp;nbsp;Recognition&amp;nbsp;in android application&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Here is the tutorial to create android application which will convert voice to text, and then that text you can use where ever you want.&lt;br /&gt;
&lt;br /&gt;
First create the Android project and follow the below steps [I had give VoiceToText as project name]-&lt;br /&gt;
&lt;br /&gt;
1. No changes are required in AndroidManifest.xml file. Just for your reference below is my AndroidManifest.xml file&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color: #cccccc;&quot;&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;s1&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;s1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;xml&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&lt;/span&gt;version&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;1.0&quot;&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&lt;/span&gt;encoding&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;utf-8&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;s1&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;manifest&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;xmlns:android&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&quot;http://schemas.android.com/apk/res/android&quot;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;package&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&quot;com.voicetotext&quot;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;android:versionCode&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;1&quot;&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;android:versionName&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;1.0&quot;&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;uses-sdk&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&lt;/span&gt;android:minSdkVersion&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;8&quot;&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;lt;&lt;/span&gt;application&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;android:icon&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&quot;@drawable/ic_launcher&quot;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;android:label&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&quot;@string/app_name&quot;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p5&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;s1&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;activity&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;android:label&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&quot;@string/app_name&quot;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;android:name&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&quot;.VoiceToTextActivity&quot;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p5&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;s1&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;intent-filter&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;action&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;android:name&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&quot;android.intent.action.MAIN&quot;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;category&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;android:name&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&quot;android.intent.category.LAUNCHER&quot;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;s1&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;s1&quot;&gt;intent-filter&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p5&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;s1&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;s1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;activity&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;s1&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;s1&quot;&gt;application&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;s1&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;s1&quot;&gt;manifest&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
2. &amp;nbsp;Create UI which will have Button and list view, following is my main.xml file. [If you want you can create new file otherwise use the default main.xml file]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color: #cccccc;&quot;&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&lt;span class=&quot;s1&quot;&gt;&amp;lt;?&lt;span class=&quot;s2&quot;&gt;xml&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&lt;/span&gt;version&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;1.0&quot;&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&lt;/span&gt;encoding&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;utf-8&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&lt;span class=&quot;s1&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;LinearLayout&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;xmlns:android&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&quot;http://schemas.android.com/apk/res/android&quot;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;android:layout_width&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;android:layout_height&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;i&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;android:orientation&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;vertical&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/i&gt;&lt;i&gt;&amp;nbsp;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;lt;&lt;/span&gt;TextView&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;android:layout_width&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;android:layout_height&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;android:paddingBottom&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;4dip&quot;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;android:text&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&quot;Click button and start speaking&quot;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;Button&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;android:id&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&quot;@+id/speakBtn&quot;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;android:layout_width&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;android:onClick&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&quot;speakButtonClicked&quot;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;android:layout_height&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;wrap_content&quot;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;android:text&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;Hit Me!&quot;&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;ListView&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;android:id&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&quot;@+id/resultList&quot;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;android:layout_width&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;fill_parent&quot;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;android:layout_height&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;0dip&quot;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;android:layout_weight&lt;span class=&quot;s3&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;1&quot;&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&lt;span class=&quot;s3&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;i&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;s1&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;i&gt;&lt;span class=&quot;s3&quot;&gt;LinearLayout&lt;span class=&quot;s1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
3. Now need to code your main activity class, once user hit the Hit Me! button it will listen and translate voice to text and display that into resultList list view. Following is my main activity class -&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color: #cccccc;&quot;&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;package com.voicetotext;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;import android.app.Activity;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;import android.os.Bundle;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;import android.content.Intent;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;import android.content.pm.PackageManager;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;import android.content.pm.ResolveInfo;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;import android.speech.RecognizerIntent;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;import android.view.View;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;import android.widget.ArrayAdapter;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;import android.widget.Button;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;import android.widget.ListView;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;import java.util.ArrayList;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;import java.util.List;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;public class VoiceToTextActivity extends Activity {&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; private static final int REQUEST_CODE = 1234;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; private ListView resultList;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; /**&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Called when the activity is first created.&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;*/&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; @Override&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; public void onCreate(Bundle savedInstanceState)&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; super.onCreate(savedInstanceState);&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; setContentView(R.layout.main);&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Button speakBtn = (Button) findViewById(R.id.speakBtn);&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; resultList = (ListView) findViewById(R.id.resultList);&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Disable button if no recognition service is present&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; PackageManager pm = getPackageManager();&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; List&lt;resolveinfo&gt; RecognizerActivities = pm.queryIntentActivities(&lt;/resolveinfo&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0);&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (RecognizerActivities.size() == 0)&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; speakBtn.setEnabled(false);&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; speakBtn.setText(&quot;Recognizer unavailable!!!&quot;);&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; /**&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Handle the action of the button being clicked&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;*/&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; public void speakButtonClicked(View v)&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; startVoiceRecognitionActivity();&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; /**&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Fire an intent to start the voice recognition activity.&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;*/&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; private void startVoiceRecognitionActivity()&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; intent.putExtra(RecognizerIntent.EXTRA_PROMPT, &quot;Voice To Text Demo…&quot;);&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; startActivityForResult(intent, REQUEST_CODE);&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; /**&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* Handle the results from the voice recognition activity.&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;*/&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; @Override&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; protected void onActivityResult(int requestCode, int resultCode, Intent data)&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (requestCode == REQUEST_CODE &amp;amp;&amp;amp; resultCode == RESULT_OK)&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Populate the resultList with the String values the recognition engine thought it heard&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ArrayList&lt;string&gt; matches = data.getStringArrayListExtra(&lt;/string&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; RecognizerIntent.EXTRA_RESULTS);&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; resultList.setAdapter(new ArrayAdapter&lt;string&gt;(this, android.R.layout.simple_list_item_1,&lt;/string&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; matches));&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; super.onActivityResult(requestCode, resultCode, data);&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;i style=&quot;background-color: #cccccc;&quot;&gt;}&lt;/i&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;
Now you can run this application and speak the word or sentences, it will start converting those words into text and later you can use those text as a command to perform any tasks.&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
Note: This will not work on&amp;nbsp;emulator, you will need actual device to test this application.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techtalk-java.blogspot.com/feeds/1442435595259552292/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://techtalk-java.blogspot.com/2012/01/how-to-implement-voice-android.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7545725017020566519/posts/default/1442435595259552292'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7545725017020566519/posts/default/1442435595259552292'/><link rel='alternate' type='text/html' href='http://techtalk-java.blogspot.com/2012/01/how-to-implement-voice-android.html' title='How to implement Voice Recognition in android application'/><author><name>Raghvendra Kamlesh</name><uri>http://www.blogger.com/profile/14452008368850267332</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-7545725017020566519.post-63512697583827799</id><published>2011-11-21T19:47:00.001-05:00</published><updated>2011-11-21T19:52:12.410-05:00</updated><title type='text'>Avoid Cross Site Scripting popup in IE</title><content type='html'>&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;b style=&quot;font-family: arial;&quot;&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;Avoid Cross Site Scripting popup in IE&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: arial; font-size: small;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: arial;&quot;&gt;
Microsoft IE has a security feature called, Cross Site Scripting (XSS) Filter, in which IE doesn&#39;t allow cross site script to run and help to prevent cross site attack. To avoid this popup there is a setting in IE which is enable by default. To disable this popup, follow the below steps -&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;font-family: arial;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: arial;&quot;&gt;
&lt;ul&gt;
&lt;li&gt;Goto &lt;i&gt;Tools--&amp;gt;Internet Option&lt;/i&gt;.&lt;/li&gt;
&lt;li&gt;Click on the &lt;i&gt;Security&lt;/i&gt; Tab&lt;/li&gt;
&lt;li&gt;Click on &lt;i&gt;Custom Level &lt;/i&gt;Button&lt;/li&gt;
&lt;li&gt;Scroll down till the end and look for &quot;&lt;span style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; line-height: 17px; text-align: left;&quot;&gt;&lt;i&gt;Enable XSS Filter&lt;/i&gt;&quot; setting.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; line-height: 17px; text-align: left;&quot;&gt;Select &quot;&lt;i&gt;Disabled&lt;/i&gt;&quot; and click on &lt;i&gt;OK&lt;/i&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; line-height: 17px; text-align: left;&quot;&gt;Restart your browser and you will not see any cross site script popup.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Helvetica, Arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 17px;&quot;&gt;The above approach will not work if you have huge number of clients and asking all of them to follow the above steps will be tedious for them. There is a way to handle this from application front.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: arial; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Helvetica, Arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 17px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: arial; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Helvetica, Arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 17px;&quot;&gt;IE browser read the &quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Arial, sans-serif;&quot;&gt;X-XSS-Protection&quot; header, and if the value of this header is set to 0, IE doesn&#39;t show the cross site script popup.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: arial; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Arial, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: arial; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Arial, sans-serif;&quot;&gt;To set this in java, you can set the header in response object as given below -&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: arial; text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: Arial, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: arial; text-align: left;&quot;&gt;
&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: white; font-family: Monaco, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Lucida Console&#39;, monospace; text-align: -webkit-auto; white-space: pre-wrap;&quot;&gt;response&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: white; font-family: Monaco, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Lucida Console&#39;, monospace; text-align: -webkit-auto; white-space: pre-wrap;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: white; font-family: Monaco, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Lucida Console&#39;, monospace; text-align: -webkit-auto; white-space: pre-wrap;&quot;&gt;setHeader&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: white; font-family: Monaco, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Lucida Console&#39;, monospace; text-align: -webkit-auto; white-space: pre-wrap;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;background-color: white; font-family: Monaco, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Lucida Console&#39;, monospace; text-align: -webkit-auto; white-space: pre-wrap;&quot;&gt;&quot;X-XSS-protection&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: white; font-family: Monaco, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Lucida Console&#39;, monospace; text-align: -webkit-auto; white-space: pre-wrap;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: white; font-family: Monaco, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Lucida Console&#39;, monospace; text-align: -webkit-auto; white-space: pre-wrap;&quot;&gt; 0&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: white; font-family: Monaco, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Lucida Console&#39;, monospace; text-align: -webkit-auto; white-space: pre-wrap;&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: arial; text-align: left;&quot;&gt;
&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: white; font-family: Monaco, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Lucida Console&#39;, monospace; text-align: -webkit-auto; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: arial; text-align: left;&quot;&gt;
&lt;span class=&quot;pun&quot; style=&quot;background-color: white; font-family: Monaco, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Lucida Console&#39;, monospace; text-align: -webkit-auto; white-space: pre-wrap;&quot;&gt;You can set the same header in any language before sending response to client and browser will respect this header.&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techtalk-java.blogspot.com/feeds/63512697583827799/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://techtalk-java.blogspot.com/2011/11/avoid-cross-site-scripting-popup-in-ie.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7545725017020566519/posts/default/63512697583827799'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7545725017020566519/posts/default/63512697583827799'/><link rel='alternate' type='text/html' href='http://techtalk-java.blogspot.com/2011/11/avoid-cross-site-scripting-popup-in-ie.html' title='Avoid Cross Site Scripting popup in IE'/><author><name>Ragh</name><uri>http://www.blogger.com/profile/03006693350083407737</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-7545725017020566519.post-6251013987244691368</id><published>2011-11-21T19:06:00.001-05:00</published><updated>2011-11-21T19:13:09.378-05:00</updated><title type='text'></title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;&lt;u&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;How to Make configuration changes in apk file&amp;nbsp;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial;&quot;&gt;Decompile apk, make changes, compile and create apk.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;font-family: arial; text-align: -webkit-auto;&quot; /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial; text-align: -webkit-auto;&quot;&gt;Android puts all the resources in binary format under the apk file, and cannot be read by unpacking the apk file. It needs tool to unzip/decompile so that we can read it and if required, we can make some configuration changes and again create the apk with those changes.&lt;/span&gt;&lt;br style=&quot;font-family: arial; text-align: -webkit-auto;&quot; /&gt;&lt;br style=&quot;font-family: arial; text-align: -webkit-auto;&quot; /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial; text-align: -webkit-auto;&quot;&gt;In my example, I am updating the VersionName in AndroidManifest.xml file.&lt;/span&gt;&lt;br style=&quot;font-family: arial; text-align: -webkit-auto;&quot; /&gt;&lt;br style=&quot;font-family: arial; text-align: -webkit-auto;&quot; /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial; text-align: -webkit-auto;&quot;&gt;Need to follow the below steps -&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;font-family: arial; text-align: -webkit-auto;&quot; /&gt;&lt;br style=&quot;font-family: arial; text-align: -webkit-auto;&quot; /&gt;&lt;ul style=&quot;font-family: arial; text-align: -webkit-auto;&quot;&gt;
&lt;li&gt;Setup the apkTool -&lt;/li&gt;
&lt;/ul&gt;
&lt;ol style=&quot;text-align: -webkit-auto;&quot;&gt;&lt;ul&gt;
&lt;li style=&quot;font-family: arial;&quot;&gt;Download apktool-install-windows-* and apktool* file from&amp;nbsp;&lt;a href=&quot;http://code.google.com/p/android-apktool/&quot; target=&quot;_blank&quot;&gt;http://code.google.com/p/&lt;wbr&gt;&lt;/wbr&gt;android-apktool/&lt;/a&gt;&amp;nbsp;link.&lt;/li&gt;
&lt;li style=&quot;font-family: arial;&quot;&gt;Unpack both these downloaded files into some directory into your local machine (we will refer this location as root directory in our below examples).&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial;&quot;&gt;If you want to use this frequently, set this path into your environment variable, this is not&amp;nbsp;mandatory&amp;nbsp;step.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/ol&gt;
&lt;ul style=&quot;font-family: arial; text-align: -webkit-auto;&quot;&gt;
&lt;li&gt;Open command prompt and go to your root path.&lt;/li&gt;
&lt;li&gt;To decompile your apk, use below command -&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;apktool d ApkToolTest.apk&lt;/span&gt;&lt;/i&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;div style=&quot;font-family: arial; margin-left: 80px; text-align: -webkit-auto;&quot;&gt;
Note: Here I have ApkToolTest.apk file which I have created to demo this and copied that apk file into root directory.&lt;br /&gt;Once you run the above command you will see the output like this -&lt;br /&gt;&lt;br /&gt;&lt;i&gt;I: Baksmaling...&lt;br /&gt;I: Loading resource table...&lt;br /&gt;I: Loaded.&lt;br /&gt;I: Loading resource table from file: C:\Users\raghvendra\apktool\&lt;wbr&gt;&lt;/wbr&gt;framework\1.apk&lt;br /&gt;I: Loaded.&lt;br /&gt;I: Decoding file-resources...&lt;br /&gt;I: Decoding values*/* XMLs...&lt;br /&gt;I: Done.&lt;br /&gt;I: Copying assets and libs...&lt;/i&gt;&lt;/div&gt;
&lt;br style=&quot;font-family: arial; text-align: -webkit-auto;&quot; /&gt;&lt;div style=&quot;font-family: arial; margin-left: 80px; text-align: -webkit-auto;&quot;&gt;
Once this is done, you will see ApkToolTest folder in root directory, with all the resources.&amp;nbsp;&lt;/div&gt;
&lt;ul style=&quot;font-family: arial; text-align: -webkit-auto;&quot;&gt;
&lt;li&gt;Make the changes into any of the configuration file, In my case, I made the changes in AndroidManifest.xml file and updated the VersionName field.&lt;/li&gt;
&lt;li&gt;Once you done with all your changes, run the below command to again compile the project and create the apk file again -&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;apktool b ApkToolTest&lt;/span&gt;&lt;/i&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;div style=&quot;font-family: arial; margin-left: 80px; text-align: -webkit-auto;&quot;&gt;
The above command will output like below -&lt;br /&gt;&lt;br /&gt;&lt;i&gt;I: Checking whether sources has changed...&lt;br /&gt;I: Smaling...&lt;br /&gt;I: Checking whether resources has changed...&lt;br /&gt;I: Building resources...&lt;br /&gt;I: Building apk file...&lt;/i&gt;&lt;br /&gt;&lt;/div&gt;
&lt;ul style=&quot;font-family: arial; text-align: -webkit-auto;&quot;&gt;
&lt;li&gt;Once that&#39;s done you will find the ApkToolTest.apk file having updated resources information You can find the updated apk under dist folder, In my case it is \ApkToolTest\dist\ApkToolTest.&lt;wbr&gt;&lt;/wbr&gt;apk. You can deploy this updated apk file to any devices, or Market, or any app store.&lt;/li&gt;
&lt;li&gt;Once you try to install this app onto emulator or any device before releasing to any of the public use, and if you see &quot;INSTALL_PARSE_FAILED_NO_&lt;wbr&gt;&lt;/wbr&gt;CERTIFICATES&quot; error, then you have to sign your apk. To sign apk follow the below steps -&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Make sure you have all the required setup ready to sign your apk Refer this link - &quot;&lt;a href=&quot;http://developer.android.com/guide/publishing/app-signing.html&quot; target=&quot;_blank&quot;&gt;http://developer.android.com/&lt;wbr&gt;&lt;/wbr&gt;guide/publishing/app-signing.&lt;wbr&gt;&lt;/wbr&gt;html&lt;/a&gt;&quot;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Generate your private key and run the jarsigner to sign your apk file.&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techtalk-java.blogspot.com/feeds/6251013987244691368/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://techtalk-java.blogspot.com/2011/11/how-to-make-configuration-changes-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7545725017020566519/posts/default/6251013987244691368'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7545725017020566519/posts/default/6251013987244691368'/><link rel='alternate' type='text/html' href='http://techtalk-java.blogspot.com/2011/11/how-to-make-configuration-changes-in.html' title=''/><author><name>Raghvendra Kamlesh</name><uri>http://www.blogger.com/profile/14452008368850267332</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-7545725017020566519.post-800174890636324798</id><published>2011-11-15T20:56:00.000-05:00</published><updated>2011-11-21T11:05:32.893-05:00</updated><title type='text'>How to setup Android Development Environment on Mac</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana,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: Verdana,sans-serif;&quot;&gt;Setting up the develop environment for Android is little tricky in MAC OS. To setup development environment in Mac OS for android, follow the below steps -&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana,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: Verdana,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;i&gt;&lt;u&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana,sans-serif;&quot;&gt;Android SDK installation:&lt;/span&gt;&lt;/u&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana,sans-serif;&quot;&gt;First need to download the Android SDK from &lt;a href=&quot;http://developer.android.com/sdk/index.html&quot;&gt;http://developer.android.com/sdk/index.html&lt;/a&gt;. [Note: download the MAC OS sdk from the list.]&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana,sans-serif;&quot;&gt;Unzip the downloaded sdk and copy this in some location into your local drive. I am copying into /Applications, so my path will become &quot;/Applications/android-sdk-macosx/&quot;.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana,sans-serif;&quot;&gt;Add the JAVA_HOME, ANDROID_SDK, PATH, and NO_NEON into .bashrc file. To add these entry into your .bashrc file follow the below steps:&lt;/span&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana,sans-serif;&quot;&gt;First check if the file is exists, open Terminal.app (in Applications/Utilities) and type &quot;ls -a ~/&quot; This will list all of the file in your home directory. If .bashrc exists, then you can edit the file by typing &quot;open -a /Applications/TextEdit.app .bashrc&quot;.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana,sans-serif;&quot;&gt;If the file doesn&#39;t exist, then open TextEdit, select Format=&amp;gt;Make Plain Text, then paste in the necessary commands. Once that&#39;s done, go to File=&amp;gt;Save As, uncheck &quot;If no extension is provided, use &quot;.txt&quot;, type in the name &quot;.bashrc&quot;, and save the file. TextEdit will warn you that files beginning with a &quot;.&quot; are reserved for the system. Click the &quot;Use &#39;.&#39;&quot; button. Note: Remember to save this on your home location.&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana,sans-serif;&quot;&gt;Add Following entries into your .bashrc file -&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;export ANDROID_SDK=/Applications/android-sdk-macosx/&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;export PATH=$PATH:$ANDROID_SDK/tools:$ANDROID_SDK/platform-tools&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;export NO_NEON=1&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;ul&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana,sans-serif;&quot;&gt;Details about above configuration -&lt;/span&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana,sans-serif;&quot;&gt;Some Mac OS comes with the 64bit version of Java 1.6 installed by default. so we are setting the JAVA_HOME to point at it.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana,sans-serif;&quot;&gt;The PATH is not required alias but will make it easy for you to run the Android SDK Manager by typing “android” or the Android Debug Bridge by typing “adb” in the Terminal.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana,sans-serif;&quot;&gt;Set NO_NEON to prevent Android compilation from using the Neon CPU enhancements which are not supported on all Android devices (including the Emulator).&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana,sans-serif;&quot;&gt;Run Android SDK manager to install support for one or more Android OS platform versions. [Not mandatory to install all versions, but at least one version will require to proceed with the further steps.] To install run the $ANDROID_SDK/tools/android command and select at least one sdk and API version. It might take some time depending upon your selection.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;i&gt;&lt;u&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana,sans-serif;&quot;&gt;Android NDK installation:&lt;/span&gt;&lt;/u&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;i&gt;&lt;u&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/u&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #333333; line-height: 16px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; The Android NDK is a toolset that lets you embed components that make use of native code in your Android applications.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: Verdana,sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 16px;&quot;&gt;Download Android NDK from&amp;nbsp;&lt;a href=&quot;http://developer.android.com/sdk/ndk/index.html&quot;&gt;http://developer.android.com/sdk/ndk/index.html&lt;/a&gt;. [Note: Download the MAC OS version from the list]&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: Verdana,sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 16px;&quot;&gt;Unzip the downloaded ndk and copy this into some location into your local drive. I am copying into /Applications, so my path will be &quot;/Applications/android-ndk-r7&quot;.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: Verdana,sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 16px;&quot;&gt;Add below entries into your .bashrc file -&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;div style=&quot;color: #333333; line-height: 16px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;i&gt; export ANDROID_NDK=/Applications/android-ndk-r7&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #333333; line-height: 16px;&quot;&gt;
&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; export PATH=$PATH:$ANDROID_NDK:$ANDROID_NDK/tool&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;color: #333333; line-height: 16px;&quot;&gt;
&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;color: #333333;&quot;&gt;
&lt;div style=&quot;color: black; line-height: normal;&quot;&gt;
&lt;b&gt;&lt;i&gt;&lt;u&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana,sans-serif;&quot;&gt;Android Eclipse Plugin installation (ADT):&lt;/span&gt;&lt;/u&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: Verdana,sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 16px;&quot;&gt;Start Eclipse.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: Verdana,sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 16px;&quot;&gt;Click on Help--&amp;gt;Install New Software.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 16px;&quot;&gt;Put&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;https://dl-ssl.google.com/android/eclipse/” into the “Work with:” field.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana,sans-serif;&quot;&gt;Press Enter, check the below table will populate automatically with the options.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana,sans-serif;&quot;&gt;Check the Developer Tool check box to select all.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana,sans-serif;&quot;&gt;Click Next, Next and select the Accept agreement And Finish.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana,sans-serif;&quot;&gt;Once it will finish the installation, It will ask you for the restart, so click on Restart Now to restart eclipse.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;div style=&quot;color: #333333;&quot;&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;b&gt;&lt;i&gt;&lt;u&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana,sans-serif;&quot;&gt;Android Eclipse Plugin Configuration (ADT):&lt;/span&gt;&lt;/u&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;b&gt;&lt;i&gt;&lt;u&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/u&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;color: black;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; line-height: 16px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Once Eclipse restarted, We need to configure the installed ADT plugin.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: Verdana,sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 16px;&quot;&gt;Goto Eclipse--&amp;gt;Preferences menu.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: Verdana,sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 16px;&quot;&gt;Select Android from the left side list.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 16px;&quot;&gt;Put your $ANDROID_SDK location into&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;SDK Location field. In my case it&#39;s &quot;/Applications/android-sdk-macosx&quot;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana,sans-serif;&quot;&gt;Click on Apply button and you will see all the android platform versions which you had installed before.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana,sans-serif;&quot;&gt;Hit OK, and now your Android development environment is all setup correctly.&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana,sans-serif;&quot;&gt;********** Create Hello world app to start with ***************&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #333333; font-size: small; line-height: 16px;&quot;&gt;
&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techtalk-java.blogspot.com/feeds/800174890636324798/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://techtalk-java.blogspot.com/2011/11/android-development-environment-setup_15.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7545725017020566519/posts/default/800174890636324798'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7545725017020566519/posts/default/800174890636324798'/><link rel='alternate' type='text/html' href='http://techtalk-java.blogspot.com/2011/11/android-development-environment-setup_15.html' title='How to setup Android Development Environment on Mac'/><author><name>Raghvendra Kamlesh</name><uri>http://www.blogger.com/profile/14452008368850267332</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-7545725017020566519.post-886619990979276930</id><published>2011-11-14T22:04:00.001-05:00</published><updated>2011-11-21T11:05:50.200-05:00</updated><title type='text'>How to setup Android Development Environment on Windows</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;br /&gt;
To setup development environment in windows machine for android, follow the below steps -&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Install Java version 1.5 or above .&lt;/li&gt;
&lt;li&gt;Download Android-sdk_rXX-windows.zip from http://developer.android.com/sdk/index.html &lt;/li&gt;
&lt;li&gt;Extract Android-sdk_rXX-windows.zip into C:\Android or your favorite folder on your local drive.&lt;/li&gt;
&lt;li&gt;Append “C:\Android\android-sdk-windows\tools” to PATH environment variable value as shown below.&lt;/li&gt;
&lt;/ul&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/AVvXsEiT-yqpzGVoKfGZ6lne7ARLAhbFDDTkTjTCnmnPEHLVLiE_rn-hi3onxu6ChRr8_jdKZp1W4XHmWdJmkupvOmk4uUwzP5_LzsWBGTvuA2zi1hdNvjeGIfVszcWM_fU3yq2pHJlhOcIKK9x9/s1600/Android1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;392&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiT-yqpzGVoKfGZ6lne7ARLAhbFDDTkTjTCnmnPEHLVLiE_rn-hi3onxu6ChRr8_jdKZp1W4XHmWdJmkupvOmk4uUwzP5_LzsWBGTvuA2zi1hdNvjeGIfVszcWM_fU3yq2pHJlhOcIKK9x9/s640/Android1.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&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&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Install Eclipse - Europa, GyneMede, Galileo etc. [Note: From here on, we will be presenting the slide sequence as in Eclipse Galileo.]&lt;/li&gt;
&lt;li&gt;Start Eclipse. &lt;/li&gt;
&lt;li&gt;Go to Help -&amp;gt;Install New Software- &amp;gt;Click on Add Button -&amp;gt;”Add Site” box will open. &lt;/li&gt;
&lt;li&gt;In Name text box type “Android Plugin” and in Location (URL) text box type “https://dl-ssl.google.com/android/eclipse/” .Click OK and then Finish.&lt;/li&gt;
&lt;/ul&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/AVvXsEgL-k703C7XajciWuRi1lwE-ZmJy286tZJ8ZuJN1XMruf_P2JZrXraVYW5yg6f9LbTxGQMFx5tcth4EvTFn20RnkVX_dpLzk687kR7IkAEmHyFWysBRZkgMGj51GrycHTOWThr2dDJwt8tV/s1600/Android2.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;br /&gt;&lt;/a&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgL-k703C7XajciWuRi1lwE-ZmJy286tZJ8ZuJN1XMruf_P2JZrXraVYW5yg6f9LbTxGQMFx5tcth4EvTFn20RnkVX_dpLzk687kR7IkAEmHyFWysBRZkgMGj51GrycHTOWThr2dDJwt8tV/s1600/Android2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;424&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgL-k703C7XajciWuRi1lwE-ZmJy286tZJ8ZuJN1XMruf_P2JZrXraVYW5yg6f9LbTxGQMFx5tcth4EvTFn20RnkVX_dpLzk687kR7IkAEmHyFWysBRZkgMGj51GrycHTOWThr2dDJwt8tV/s640/Android2.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&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/AVvXsEh0x17d5hyphenhyphenTfQ5G7TdOzPDel0nwG63auxz1kdO3BFn_yDKPgo4Q_6w7xdfzKq8j38vNeV2MvTkld7Oz1SMa6h8RvtOnN8B9rkhOmglZYjoy3sQyn_0pAHx-g-IMvS9Ns2aKyWu9DblCsOIF/s1600/Android3.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;580&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0x17d5hyphenhyphenTfQ5G7TdOzPDel0nwG63auxz1kdO3BFn_yDKPgo4Q_6w7xdfzKq8j38vNeV2MvTkld7Oz1SMa6h8RvtOnN8B9rkhOmglZYjoy3sQyn_0pAHx-g-IMvS9Ns2aKyWu9DblCsOIF/s640/Android3.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&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;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbMwrMXqDCyDmC2nwN9Zx0k04BZOyyC7JvRDszHza_H8kxnWrYsNt0R9uxYWCPCmVks4pXrqZ5FtJoHKR8A43j8vdFUTpM5xizsgjVAu2IVTu48Jj9ysoGwKyQekFtY3y3WeRwrK5e-M0a/s1600/Android4.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;620&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbMwrMXqDCyDmC2nwN9Zx0k04BZOyyC7JvRDszHza_H8kxnWrYsNt0R9uxYWCPCmVks4pXrqZ5FtJoHKR8A43j8vdFUTpM5xizsgjVAu2IVTu48Jj9ysoGwKyQekFtY3y3WeRwrK5e-M0a/s640/Android4.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;In Install box, you will see list of “All Available software” “Work with” drop down. Select “Android PlugIn - https://dl-ssl.google.com/android/eclipse/”.&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&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/AVvXsEhE1xdqq53c4UwfRd-nup2R6DH1PzANjniUOPzZvH8vfV_OeayU_CBT9LI_vTWFH__8cnvlT-7g1fm91JY5gny4WHYJCZB7OrP8dxCXKpBkxC4rTidkQkOnrybxlZVF4MTISDvkfc7E4GfJ/s1600/Android5.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;616&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhE1xdqq53c4UwfRd-nup2R6DH1PzANjniUOPzZvH8vfV_OeayU_CBT9LI_vTWFH__8cnvlT-7g1fm91JY5gny4WHYJCZB7OrP8dxCXKpBkxC4rTidkQkOnrybxlZVF4MTISDvkfc7E4GfJ/s640/Android5.png&quot; width=&quot;640&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;/div&gt;
&lt;ul&gt;
&lt;li style=&quot;text-align: left;&quot;&gt;In “Name” box , you will see check box “Developer Tools” (On clicking +, Android DDMS and Android Toc along with &lt;span class=&quot;Apple-style-span&quot; style=&quot;text-align: left;&quot;&gt;version should be visible). Select all and click finish.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&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;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgi62Y-yHx763x7QP8QPTpkrhR_hhx2zDGFUH8io4hnCQhAukzlsI_zbBh37FMOnDLZ5pPHA3j21gzotjGcbK-qr66yaBLChPm_0pMOZIXx5trLqWNa2qw-xzW0P1qH4AEqrJ7J_dTN-NJ2/s1600/Android6.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;612&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgi62Y-yHx763x7QP8QPTpkrhR_hhx2zDGFUH8io4hnCQhAukzlsI_zbBh37FMOnDLZ5pPHA3j21gzotjGcbK-qr66yaBLChPm_0pMOZIXx5trLqWNa2qw-xzW0P1qH4AEqrJ7J_dTN-NJ2/s640/Android6.png&quot; width=&quot;640&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;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Installation will take some time. To check if Android is installed correctly go to Window-&amp;gt;Preferences -&amp;gt;Install/Update-&amp;gt;Available Software sites. “Android PlugIn - https://dl-ssl.google.com/android/eclipse/” Should be visible under “Name” and “Location” section. You can also check from command prompt using the command – “Android”.&lt;/li&gt;
&lt;/ul&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/AVvXsEgbahyphenhyphenxgwT25kbKAkfpm8-zibyO1gEIsWsee4ei9anQWpwQ2WvZ_QPQu-Mk6ZxUZ4hM7y_7H7akF8AvpUed1Kv8h0dUc80iesdzIFqtavjtEwaTdtHy1Y6nle-8Np2r5hSV_DNjOgwQD65p/s1600/Android7.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbahyphenhyphenxgwT25kbKAkfpm8-zibyO1gEIsWsee4ei9anQWpwQ2WvZ_QPQu-Mk6ZxUZ4hM7y_7H7akF8AvpUed1Kv8h0dUc80iesdzIFqtavjtEwaTdtHy1Y6nle-8Np2r5hSV_DNjOgwQD65p/s640/Android7.png&quot; width=&quot;630&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&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/AVvXsEiut5lT6bRF4KE6DL0J7BqWk168rnbGWvly0IFCk3vMH-DAzYK_DY22d8k2nIzNZBSYkC5P4SxzYY5egJw1dd4ShyphenhyphenG2msHE6iXvefFy6oh6_0CARTNUfejPWIRsxTgPdYB-3CnnQKhm_dQz/s1600/Android8.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;474&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiut5lT6bRF4KE6DL0J7BqWk168rnbGWvly0IFCk3vMH-DAzYK_DY22d8k2nIzNZBSYkC5P4SxzYY5egJw1dd4ShyphenhyphenG2msHE6iXvefFy6oh6_0CARTNUfejPWIRsxTgPdYB-3CnnQKhm_dQz/s640/Android8.png&quot; width=&quot;640&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&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Select Window -&amp;gt;“Android SDK and ADV Manager”, A dialogue box will open with three Options on left hand side: &lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Virtual Devices &lt;/li&gt;
&lt;li&gt;Installed Packages &lt;/li&gt;
&lt;li&gt;Available Packages&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&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/AVvXsEi0-ff-5ec5bRWRn2BK5KVqMW2rw8zvhx5BNdu9iq-X96xIuEngMnnNa0rpv2fWBpPcO2Q5GFS7KGmIpv51_PkIFDch6zUwRmBSBWSGEatqLpM3CBCGrwJNZxkh-0cOZjKov1forhixojfo/s1600/Android9.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0-ff-5ec5bRWRn2BK5KVqMW2rw8zvhx5BNdu9iq-X96xIuEngMnnNa0rpv2fWBpPcO2Q5GFS7KGmIpv51_PkIFDch6zUwRmBSBWSGEatqLpM3CBCGrwJNZxkh-0cOZjKov1forhixojfo/s640/Android9.png&quot; width=&quot;586&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&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/AVvXsEhWmYW8A8TyLzrKop4CrfoZ96NwH7_Eo05XdSDX-YMU3qRFror0A5HUJqAh6hxIX9XWNFso-ZnMtg255XWj9SJWnxn1hdimR1vVpT4leQJE2HJs3wl2u37uBPcbfCu9uS-V1Fu0BuunyX2S/s1600/Android10.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;382&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWmYW8A8TyLzrKop4CrfoZ96NwH7_Eo05XdSDX-YMU3qRFror0A5HUJqAh6hxIX9XWNFso-ZnMtg255XWj9SJWnxn1hdimR1vVpT4leQJE2HJs3wl2u37uBPcbfCu9uS-V1Fu0BuunyX2S/s640/Android10.png&quot; width=&quot;640&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&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Select “Available Packages”, Expand “+” icon, choose “SDK Platform 2.1, API 7, revision 1”. [Note: Please do not select all SDK versions available since it will take too much time to download.]&lt;/li&gt;
&lt;li&gt;Select “Virtual Devices” and click on “New” button on right hand side.&lt;/li&gt;
&lt;li&gt;“Create new AVD Manager” box will open. In “Name” text box, enter appropriate name for e.g. “AVD”. In Target drop down select “Android 2.1 – API Level 7”and click on “Create AVD” Button.&lt;/li&gt;
&lt;/ul&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/AVvXsEhbq6RLelyZkgBNM19wPCL9k7suLm4u2NqOTVpoTdBXod6dzG7ORPY0idAjJj5ZydC42EABoeV5qSSB_AJjSsRyclQWABpdatP6AdAOU2GJyiKlQzg38J26iYC_ls5IxvsPMFMGTEoGcWz3/s1600/Android11.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;534&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbq6RLelyZkgBNM19wPCL9k7suLm4u2NqOTVpoTdBXod6dzG7ORPY0idAjJj5ZydC42EABoeV5qSSB_AJjSsRyclQWABpdatP6AdAOU2GJyiKlQzg38J26iYC_ls5IxvsPMFMGTEoGcWz3/s640/Android11.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;And it’s all done. You are ready to create “Android Application” as a normal Java Program.&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
****** Send me email if you have any queries regarding this post *********&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techtalk-java.blogspot.com/feeds/886619990979276930/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://techtalk-java.blogspot.com/2011/11/android-development-environment-setup.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7545725017020566519/posts/default/886619990979276930'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7545725017020566519/posts/default/886619990979276930'/><link rel='alternate' type='text/html' href='http://techtalk-java.blogspot.com/2011/11/android-development-environment-setup.html' title='How to setup Android Development Environment on Windows'/><author><name>Raghvendra Kamlesh</name><uri>http://www.blogger.com/profile/14452008368850267332</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/AVvXsEiT-yqpzGVoKfGZ6lne7ARLAhbFDDTkTjTCnmnPEHLVLiE_rn-hi3onxu6ChRr8_jdKZp1W4XHmWdJmkupvOmk4uUwzP5_LzsWBGTvuA2zi1hdNvjeGIfVszcWM_fU3yq2pHJlhOcIKK9x9/s72-c/Android1.jpg" height="72" width="72"/><thr:total>0</thr:total></entry></feed>