<?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-5834825895105257420</id><updated>2026-08-02T07:38:46.612-07:00</updated><category term="Custom Design"/><category term="List View"/><category term="Fixing Errors"/><category term="Tabbed Layout"/><category term="Database"/><category term="SQLite"/><category term="Spinner"/><category term="Eclipse"/><category term="html"/><title type='text'>My Adventures in Android Development</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://androidgeisha.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5834825895105257420/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://androidgeisha.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>HappyGeisha</name><uri>http://www.blogger.com/profile/00311271943841904211</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>24</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5834825895105257420.post-6585258394117131086</id><published>2012-05-31T08:01:00.000-07:00</published><updated>2012-06-06T11:03:10.721-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Tabbed Layout"/><title type='text'>Changing Tab with Horizontal Swipe Gesture</title><content type='html'>This tutorial describes the code I used to change activities with a swipe or fling gesture. This is an update to my &lt;a href=&quot;http://androidgeisha.blogspot.com/2011/07/custom-horizontal-scroll-tabs.html&quot; target=&quot;_blank&quot;&gt;scrolling tab&lt;/a&gt; article.&lt;br /&gt;
&lt;br /&gt;
Lets say you want right and left &quot;swipes&quot; or &quot;flings&quot; to be able to flip through the tabs, like pages in a book.&lt;br /&gt;
&lt;br /&gt;
In my project, I am using tabs that have&amp;nbsp;separate&amp;nbsp;activities&amp;nbsp;to fill the content views.&lt;br /&gt;
&lt;br /&gt;
As far as I can tell, the gesture can be detected two ways: place the gesture listener in each activity or from just this one to control them all.&amp;nbsp;I
  placed code that handles swipes in the main activity page, the one that contains the set up for the tab host, and also sets the content for all the tabs.
&lt;br /&gt;
&lt;br /&gt;

&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--
google_ad_client = &quot;ca-pub-0203000218086978&quot;;
/* Mid-Post */
google_ad_slot = &quot;0253944060&quot;;
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;
src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;
&lt;/script&gt;

&lt;br /&gt;
&lt;br /&gt;
Here is what you add to the main java file:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;color: #0b5394;&quot;&gt;
public class GestureScrollTabActivity extends TabActivity implements OnClickListener {&lt;br /&gt;
&lt;br /&gt;
static TabHost mTabHost;&lt;br /&gt;
Intent intent;&lt;br /&gt;
private static final int SWIPE_MIN_DISTANCE = 120;&lt;br /&gt;
private static final int SWIPE_MAX_OFF_PATH = 250;&lt;br /&gt;
private static final int SWIPE_THRESHOLD_VELOCITY = 200;&lt;br /&gt;
private GestureDetector gestureDetector;&lt;br /&gt;
View.OnTouchListener gestureListener;&lt;br /&gt;
&lt;br /&gt;
/** Called when the activity is first created. */&lt;br /&gt;
@Override&lt;br /&gt;
public void onCreate(Bundle savedInstanceState) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; super.onCreate(savedInstanceState);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; setContentView(R.layout.main);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; [&lt;a href=&quot;http://androidgeisha.blogspot.com/2011/07/custom-horizontal-scroll-tabs.html&quot;&gt;...&lt;/a&gt;]&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; // Gesture detection&lt;br /&gt;
&amp;nbsp; &amp;nbsp; gestureDetector = new GestureDetector(new MyGestureDetector());&lt;br /&gt;
&amp;nbsp; &amp;nbsp; gestureListener = new View.OnTouchListener() {&lt;br /&gt;
&amp;nbsp; &amp;nbsp;  &amp;nbsp; &amp;nbsp; public boolean onTouch(View v, MotionEvent event) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp;  &amp;nbsp; &amp;nbsp; return gestureDetector.onTouchEvent(event);&lt;br /&gt;
&amp;nbsp; &amp;nbsp;  &amp;nbsp; &amp;nbsp;  }&lt;br /&gt;
&amp;nbsp; &amp;nbsp;  };&lt;br /&gt;
&amp;nbsp; &amp;nbsp;  mTabHost.setOnClickListener(GestureScrollTabActivity.this);&lt;br /&gt;
&amp;nbsp; &amp;nbsp;   mTabHost.setOnTouchListener(gestureListener);&lt;br /&gt;
&lt;br /&gt;
} // end onCreate&lt;br /&gt;
&lt;br /&gt;
[&lt;a href=&quot;http://androidgeisha.blogspot.com/2011/07/custom-horizontal-scroll-tabs.html&quot;&gt;...&lt;/a&gt;]&lt;br /&gt;
&lt;br /&gt;
class MyGestureDetector extends SimpleOnGestureListener {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; @Override&lt;br /&gt;
&amp;nbsp; &amp;nbsp;  public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp;  &amp;nbsp; &amp;nbsp; try {&lt;br /&gt;
&amp;nbsp; &amp;nbsp;  &amp;nbsp; &amp;nbsp;  &amp;nbsp; &amp;nbsp; if (Math.abs(e1.getY() - e2.getY()) &amp;gt; SWIPE_MAX_OFF_PATH)&lt;br /&gt;
&amp;nbsp; &amp;nbsp;  &amp;nbsp; &amp;nbsp;  &amp;nbsp; &amp;nbsp; return false;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;  &amp;nbsp; &amp;nbsp;  &amp;nbsp; &amp;nbsp; // right to left swipe&lt;br /&gt;
&amp;nbsp; &amp;nbsp;  &amp;nbsp; &amp;nbsp;  &amp;nbsp; &amp;nbsp; if (e1.getX() - e2.getX() &amp;gt; SWIPE_MIN_DISTANCE &amp;amp;&amp;amp; Math.abs(velocityX) &amp;gt; SWIPE_THRESHOLD_VELOCITY) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp;  &amp;nbsp; &amp;nbsp;  &amp;nbsp; &amp;nbsp;  &amp;nbsp; &amp;nbsp;  int i = mTabHost.getCurrentTab();&lt;br /&gt;
&amp;nbsp; &amp;nbsp;  &amp;nbsp; &amp;nbsp;  &amp;nbsp; &amp;nbsp;  &amp;nbsp; &amp;nbsp; mTabHost.setCurrentTab(i+1);&lt;br /&gt;
&amp;nbsp; &amp;nbsp;  &amp;nbsp; &amp;nbsp;  &amp;nbsp; &amp;nbsp;  &amp;nbsp; &amp;nbsp; Toast.makeText(GestureScrollTabActivity.this, &quot;Left Swipe&quot;, Toast.LENGTH_SHORT).show();&lt;br /&gt;
&amp;nbsp; &amp;nbsp;  &amp;nbsp; &amp;nbsp;  &amp;nbsp; &amp;nbsp; } else if (e2.getX() - e1.getX() &amp;gt; SWIPE_MIN_DISTANCE &amp;amp;&amp;amp; Math.abs(velocityX) &amp;gt; SWIPE_THRESHOLD_VELOCITY) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp;  &amp;nbsp; &amp;nbsp;  &amp;nbsp; &amp;nbsp;  &amp;nbsp; &amp;nbsp; int i = mTabHost.getCurrentTab();&lt;br /&gt;
&amp;nbsp; &amp;nbsp;  &amp;nbsp; &amp;nbsp;  &amp;nbsp; &amp;nbsp;  &amp;nbsp; &amp;nbsp; mTabHost.setCurrentTab(i-1);&lt;br /&gt;
&amp;nbsp; &amp;nbsp;  &amp;nbsp; &amp;nbsp;  &amp;nbsp; &amp;nbsp;  &amp;nbsp; &amp;nbsp; Toast.makeText(GestureScrollTabActivity.this, &quot;Right Swipe&quot;, Toast.LENGTH_SHORT).show();&lt;br /&gt;
&amp;nbsp; &amp;nbsp;  &amp;nbsp; &amp;nbsp;  &amp;nbsp; &amp;nbsp;  }&lt;br /&gt;
&amp;nbsp; &amp;nbsp;  &amp;nbsp; &amp;nbsp; } catch (Exception e) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;  &amp;nbsp; &amp;nbsp;   // nothing&lt;br /&gt;
&amp;nbsp; &amp;nbsp;  &amp;nbsp; &amp;nbsp;  }&lt;br /&gt;
&amp;nbsp; &amp;nbsp;  return false;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
@Override&lt;br /&gt;
public void onClick(View v) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Filter f = (Filter) v.getTag();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; // FilterFullscreenActivity.show(this, input, f);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; // Toast.makeText(GestureScrollTabActivity.this, &quot;onClick&quot;, Toast.LENGTH_SHORT).show();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
}&lt;/div&gt;
&lt;br /&gt;
Resources:&lt;br /&gt;
(1)   &lt;a href=&quot;http://stackoverflow.com/questions/937313/android-basic-gesture-detection&quot;&gt;http://stackoverflow.com/questions/937313/android-basic-gesture-detection&lt;/a&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;


&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--
google_ad_client = &quot;ca-pub-0203000218086978&quot;;
/* Mid-Post */
google_ad_slot = &quot;0253944060&quot;;
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;
src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;
&lt;/script&gt;

&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidgeisha.blogspot.com/feeds/6585258394117131086/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidgeisha.blogspot.com/2012/05/changing-tab-with-horizontal-swipe.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5834825895105257420/posts/default/6585258394117131086'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5834825895105257420/posts/default/6585258394117131086'/><link rel='alternate' type='text/html' href='http://androidgeisha.blogspot.com/2012/05/changing-tab-with-horizontal-swipe.html' title='Changing Tab with Horizontal Swipe Gesture'/><author><name>HappyGeisha</name><uri>http://www.blogger.com/profile/00311271943841904211</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-5834825895105257420.post-2958992767150746992</id><published>2012-01-20T09:10:00.000-08:00</published><updated>2012-01-20T09:10:29.075-08:00</updated><title type='text'>Reading a TXT File from the Emulator&#39;s &quot;SD Card&quot;</title><content type='html'>The app that I&#39;m developing has to read a TXT file from an SD card storage and display it in textview.&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/AVvXsEhVRvpqlKNkMWuEXvBEzzoBJhNJOfiyeXFXf0Y84JnJHETY_D-_DDJFvM_dX5uAmo-TFw817z4yumG7tM_Wub8efS8X6lh9aXxyQZ5yxbYnEU7IDhbzfM1Jlxxfhgtq7UvjvoI3_2rDPhQy/s1600/EditAVD.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVRvpqlKNkMWuEXvBEzzoBJhNJOfiyeXFXf0Y84JnJHETY_D-_DDJFvM_dX5uAmo-TFw817z4yumG7tM_Wub8efS8X6lh9aXxyQZ5yxbYnEU7IDhbzfM1Jlxxfhgtq7UvjvoI3_2rDPhQy/s320/EditAVD.png&quot; width=&quot;233&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
The process to get your file (&lt;i&gt;any &lt;/i&gt;file) onto the emulator&#39;s pretend SD card is kind of tricky. First you have to create the&amp;nbsp;SD&amp;nbsp;card. I did this in eclipse by opening the AVD manager, selecting the device you want to create the&amp;nbsp;SD&amp;nbsp;card in and clicking edit.&lt;br /&gt;
&lt;br /&gt;
In the edit screen, find the SD Card section and give your SD card a side. I gave mine 4&amp;nbsp;GB.&lt;br /&gt;
&lt;br /&gt;
Then you have to move your file onto the SD card. In eclipse, this can be done by running your app and opening the DDMS view. Go to the File Explorer tab. Expand the &quot;mnt&quot; folder. Select the &quot;sdcard&quot; folder. Once selected, select the button in the upper right that has an image on a phone and an arrow. This should read &quot;Push a file onto the device&quot; when you hover over it. Click it. Find the file on your hard drive and push that baby onto the phone. Whew. Now its available to be read by our app.&lt;br /&gt;
&lt;br /&gt;
Back to java. I pulled this code from someone&#39;s awesome answer on &lt;a href=&quot;http://stackoverflow.com/&quot;&gt;StackOverflow&lt;/a&gt;&amp;nbsp;but forgot to bookmark it. Sorry!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0b5394;&quot;&gt;// Find the directory for the SD Card using the API&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// *Don&#39;t* hardcode &quot;/sdcard&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;File sdcard = Environment.getExternalStorageDirectory();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// Get the text file&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;File file = new File(sdcard, &quot;filename.txt&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// Read text from file&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;StringBuilder text = new StringBuilder();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;try {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;BufferedReader br = new BufferedReader(new FileReader(file));&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;String line;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;while ((line = br.readLine()) != null) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;text.append(line);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;text.append(&#39;\n&#39;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;} catch (IOException e) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;// You&#39;ll need to add proper error handling here&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;DialogDetails.setText(
text&amp;nbsp;);&lt;/span&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidgeisha.blogspot.com/feeds/2958992767150746992/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidgeisha.blogspot.com/2012/01/reading-txt-file-from-emulators-sd-card.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5834825895105257420/posts/default/2958992767150746992'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5834825895105257420/posts/default/2958992767150746992'/><link rel='alternate' type='text/html' href='http://androidgeisha.blogspot.com/2012/01/reading-txt-file-from-emulators-sd-card.html' title='Reading a TXT File from the Emulator&#39;s &quot;SD Card&quot;'/><author><name>HappyGeisha</name><uri>http://www.blogger.com/profile/00311271943841904211</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/AVvXsEhVRvpqlKNkMWuEXvBEzzoBJhNJOfiyeXFXf0Y84JnJHETY_D-_DDJFvM_dX5uAmo-TFw817z4yumG7tM_Wub8efS8X6lh9aXxyQZ5yxbYnEU7IDhbzfM1Jlxxfhgtq7UvjvoI3_2rDPhQy/s72-c/EditAVD.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5834825895105257420.post-6241706859226793466</id><published>2012-01-13T09:23:00.000-08:00</published><updated>2012-06-06T07:49:06.820-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Database"/><category scheme="http://www.blogger.com/atom/ns#" term="SQLite"/><title type='text'>How to View Your Android App Database: SQLite Database Broswer</title><content type='html'>I&#39;ve been using SQLite Database Browser to look through my android database and make changes. Linky link:&lt;div&gt;
&lt;a href=&quot;http://sourceforge.net/projects/sqlitebrowser/&quot;&gt;http://sourceforge.net/projects/sqlitebrowser/&lt;/a&gt;&lt;br /&gt;&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
You can pull your application&#39;s database off the emulator as a .sql file and open it up in this browser to see all that fancy sql stuff.&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;u&gt;To get your database off the emulator:&lt;/u&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
First, you have to have eclipse open and running, and run your application in your emulator of choice.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Once the app is up and running, go back to eclipse and select Window &amp;gt; Open Perspective &amp;gt; DDMS&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Under the Devices tab: Make sure the emulator that is running your app is highlighted/selected. Navigate to the &quot;File Explorer&quot; tab. (If it&#39;s not available, select Window &amp;gt; Show View &amp;gt; File Explorer.)&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
In the File Explorer tab: (1) open the &quot;data&quot; folder, (2) open a second &quot;data&quot; folder, (3) find and open the folder with &quot;your application&#39;s name&quot;, (4) find and open the &quot;databases&quot; folder, (5) select the file with your application&#39;s name&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
In the upper right of the File Explorer frame, there is a button with an image of a &lt;a href=&quot;http://lmgtfy.com/?q=3.5+floppy+disk&quot;&gt;floppy disk&lt;/a&gt; with an arrow. Click on the one that says &quot;Pull a file from device&quot; and save your database file somewhere memorable. It might automatically save it to your project&#39;s location on your hard drive.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Now you can view it and play around with it in SQLite Database Browser :)&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Keep in mind that you have to upload the new database onto the phone or emulator before the changes can be accessed by your app.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidgeisha.blogspot.com/feeds/6241706859226793466/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidgeisha.blogspot.com/2012/01/how-to-view-your-android-app-database.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5834825895105257420/posts/default/6241706859226793466'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5834825895105257420/posts/default/6241706859226793466'/><link rel='alternate' type='text/html' href='http://androidgeisha.blogspot.com/2012/01/how-to-view-your-android-app-database.html' title='How to View Your Android App Database: SQLite Database Broswer'/><author><name>HappyGeisha</name><uri>http://www.blogger.com/profile/00311271943841904211</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-5834825895105257420.post-7790927660933630092</id><published>2011-07-05T09:19:00.000-07:00</published><updated>2012-06-06T07:48:08.606-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Custom Design"/><category scheme="http://www.blogger.com/atom/ns#" term="Tabbed Layout"/><title type='text'>Custom Tabs that Scroll Horizontally</title><content type='html'>So I designed horizontally scrolling tabs that use separate activities to fill the tab content. TI rate this a 1/5 on the fun scale: there are so many different files you have to create and different selection states you have to consider. (&lt;a href=&quot;http://androidgeisha.blogspot.com/2012/05/changing-tab-with-horizontal-swipe.html&quot;&gt;Click here&lt;/a&gt; for my update to this tutorial:&amp;nbsp;&lt;a href=&quot;http://androidgeisha.blogspot.com/2012/05/changing-tab-with-horizontal-swipe.html&quot;&gt;Changing Tab with Horizontal Swipe Gesture&lt;/a&gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://mskimee.altervista.org/AndroidGeisha/ScrollTab/ScrollTab.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://mskimee.altervista.org/AndroidGeisha/ScrollTab/ScrollTab.png&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif; font-size: small;&quot;&gt;Faded edges indicate additional content&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
tabhostlayout.xml - Pretty basic stuff here, if you followed the &lt;a href=&quot;http://developer.android.com/resources/tutorials/views/hello-tabwidget.html&quot;&gt;tab widget tutorial on the android dev site&lt;/a&gt;.[1] The only thing to note here is that I surrounded the tab widget with Horizontal Scroll View element to achieve a horizontal scroll for the tabs. (Note: Sorry for the formatting here. I&#39;ve tried to fix it only to make it much much worse. Blame blogger?)&lt;br /&gt;
&lt;blockquote&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;
&amp;lt;TabHost&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;android:id=&quot;@android:id/tabhost&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;android:layout_width=&quot;fill_parent&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;android:layout_height=&quot;fill_parent&quot;&amp;gt;&lt;br /&gt;
&amp;lt;LinearLayout&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:orientation=&quot;vertical&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:layout_width=&quot;fill_parent&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:layout_height=&quot;fill_parent&quot;&amp;gt;&lt;br /&gt;
&amp;lt;HorizontalScrollView&lt;br /&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;br /&gt;
&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;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&amp;lt;TabWidget&lt;br /&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/tabs&quot;&lt;br /&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;br /&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;br /&gt;
&amp;lt;/HorizontalScrollView&amp;gt;&lt;br /&gt;
&amp;lt;FrameLayout&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:id=&quot;@android:id/tabcontent&quot;&lt;br /&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;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:layout_height=&quot;fill_parent&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:padding=&quot;5dp&quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/LinearLayout&amp;gt;&lt;br /&gt;
&amp;lt;/TabHost&amp;gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
google_ad_client = &quot;ca-pub-0203000218086978&quot;;
/* Mid-Post */
google_ad_slot = &quot;0253944060&quot;;
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;

TabHostActivity.java - This activity must extend TabActivity. You will need to define the following variables and also set the divider drawable BEFORE setting up tabs
&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;
TabHost mTabHost = (TabHost) findViewById(android.R.id.tabhost);&lt;br /&gt;mTabHost.getTabWidget().setDividerDrawable(R.drawable.tab_divider);&lt;br /&gt;
Intent intent; // Reusable Intent for each tab
&lt;/span&gt;
&lt;/blockquote&gt;
&lt;br /&gt;
For each tab you would like to add, use the following code in onCreate:&lt;br /&gt;
&lt;blockquote&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;
intent = new Intent().setClass(TabHostActivity.this, PageOne.class);&lt;br /&gt;
setupTab(new TextView(this), &quot;Tab One&quot;, intent);
&lt;/span&gt;
&lt;/blockquote&gt;
&lt;br /&gt;
After onCreate, you need to add two new classes. &quot;setupTab&quot; creates the tabs and tab content. &quot;createTabView&quot; handles all tab events, like setting the views for selection events and stuff like that.&lt;br /&gt;
&lt;blockquote&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt; private void setupTab(final View view, final String tag, final Intent myIntent) {&lt;br /&gt;
View tabview = createTabView(mTabHost.getContext(), tag);
&lt;br /&gt;
TabSpec setContent = mTabHost.newTabSpec(tag).setIndicator(tabview).setContent(myIntent);&lt;br /&gt;
mTabHost.addTab(setContent);&lt;br /&gt;
}
&lt;br /&gt;
private static View createTabView(final Context context, final String text) {&lt;br /&gt;
View view = LayoutInflater.from(context).inflate(R.layout.tabs_bg, null);&lt;br /&gt;
TextView tv = (TextView) view.findViewById(R.id.tabsText);&lt;br /&gt;
tv.setText(text);&lt;br /&gt;
return view;&lt;br /&gt;
}
&lt;/span&gt;
&lt;/blockquote&gt;
&lt;br /&gt;
tabs_bg.xml - In the code above, &quot;createTabView&quot; calls a layout called tabs_bg. Create this file in the layout folder. This layout creates the layout for each tab element. I have only added a single textview but an image view could also be added (but will need some adjustments to the java code not shown above). This is where some of the layout personalization comes in. Text size and style, and padding elements. Note the background and text color call drawable files that handle the color changes for selection events.&lt;br /&gt;
&lt;blockquote&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;
&amp;lt;LinearLayout&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;android:id=&quot;@+id/tabsLayout&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;android:layout_width=&quot;fill_parent&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;android:layout_height=&quot;fill_parent&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;android:background=&quot;@drawable/tab_bg_selector&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;android:padding=&quot;3dip&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;android:gravity=&quot;center&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;android:orientation=&quot;vertical&quot;&amp;gt;&lt;br /&gt;
&amp;lt;TextView&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:layout_width=&quot;wrap_content&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:textColor=&quot;@drawable/tab_text_selector&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:gravity=&quot;center&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:textSize=&quot;12dip&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:layout_height=&quot;wrap_content&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:layout_gravity=&quot;center&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:id=&quot;@+id/tabsText&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:text=&quot;Title&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:padding=&quot;10px&quot;&amp;gt;&lt;br /&gt;
&amp;lt;/TextView&amp;gt;&lt;br /&gt;
&amp;lt;/LinearLayout&amp;gt;
&lt;/span&gt;
&lt;/blockquote&gt;
&lt;br /&gt;
tab_bg_selector.xml - both bg and text selector drawable files require the same four states to be defined: active, pressed, selected (using arrows), and inactive. I don&#39;t really know why the text and bg have to be separate files, but when I tried to combine them, it wasn&#39;t displaying properly. This code resembles custom button selection.&lt;br /&gt;
&lt;blockquote&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;
&amp;lt;selector&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;!-- &amp;nbsp;Active tab --&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;lt;item&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:state_selected=&quot;true&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:state_focused=&quot;false&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:state_pressed=&quot;false&quot;&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;shape&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:shape=&quot;rectangle&quot;&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;gradient&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:startColor=&quot;#A8A8A8&quot;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:centerColor=&quot;#7F7F7F&quot;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:endColor=&quot;#696969&quot;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:angle=&quot;-90&quot; /&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/shape&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/item&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;lt;!-- &amp;nbsp;Inactive tab --&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;br /&gt;&amp;lt;item&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:state_selected=&quot;false&quot;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:state_focused=&quot;false&quot;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:state_pressed=&quot;false&quot;&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;shape&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:shape=&quot;rectangle&quot;&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;gradient&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:startColor=&quot;#5C5C5C&quot;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:centerColor=&quot;#424242&quot;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:endColor=&quot;#222222&quot;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:angle=&quot;-90&quot; /&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/shape&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/item&amp;gt;&lt;br /&gt;
&amp;lt;!-- &amp;nbsp;Pressed tab --&amp;gt;&lt;br /&gt;
&amp;lt;item&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:state_pressed=&quot;true&quot;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:drawable=&quot;@android:color/transparent&quot; /&amp;gt;&lt;br /&gt;
&amp;lt;!-- &amp;nbsp;Selected tab (using d-pad) --&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;lt;item&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:state_selected=&quot;true&quot;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:state_focused=&quot;true&quot;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:state_pressed=&quot;false&quot;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:drawable=&quot;@android:color/transparent&quot; /&amp;gt;&lt;br /&gt;&amp;lt;/selector&amp;gt;
&lt;/span&gt;
&lt;/blockquote&gt;
&lt;br /&gt;
tab_text_selector.xml&lt;br /&gt;
&lt;blockquote&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;
&amp;lt;selector&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;item&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:state_selected=&quot;true&quot;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:color=&quot;@android:color/white&quot; /&amp;gt;&lt;br /&gt;
&amp;lt;item&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:state_focused=&quot;true&quot;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:color=&quot;@android:color/white&quot; /&amp;gt;&lt;br /&gt;
&amp;lt;item&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:state_pressed=&quot;true&quot;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:color=&quot;@android:color/white&quot; /&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;lt;item&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:color=&quot;#f8f8f8&quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/selector&amp;gt;
&lt;/span&gt;
&lt;/blockquote&gt;
&lt;br /&gt;
References:&lt;br /&gt;
1) &lt;a href=&quot;http://developer.android.com/resources/tutorials/views/hello-tabwidget.html&quot;&gt;http://developer.android.com/resources/tutorials/views/hello-tabwidget.html&lt;/a&gt;&lt;br /&gt;
2)&lt;a href=&quot;http://joshclemm.com/blog/?p=136&quot;&gt;http://joshclemm.com/blog/?p=136&lt;/a&gt;&lt;br /&gt;
For additional help, &lt;a href=&quot;http://mskimee.altervista.org/AndroidGeisha/ScrollTab/ScrollTabActivity.zip&quot; target=&quot;_blank&quot;&gt;click here to download&lt;/a&gt; a zip containing all the files needed to create the above project.&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
google_ad_client = &quot;ca-pub-0203000218086978&quot;;
/* Mid-Post */
google_ad_slot = &quot;0253944060&quot;;
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidgeisha.blogspot.com/feeds/7790927660933630092/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidgeisha.blogspot.com/2011/07/custom-horizontal-scroll-tabs.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5834825895105257420/posts/default/7790927660933630092'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5834825895105257420/posts/default/7790927660933630092'/><link rel='alternate' type='text/html' href='http://androidgeisha.blogspot.com/2011/07/custom-horizontal-scroll-tabs.html' title='Custom Tabs that Scroll Horizontally'/><author><name>HappyGeisha</name><uri>http://www.blogger.com/profile/00311271943841904211</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-5834825895105257420.post-8662819134388967112</id><published>2011-07-01T10:50:00.000-07:00</published><updated>2012-06-06T07:50:48.253-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Fixing Errors"/><title type='text'>Solution to &quot;Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE&quot;</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Source:&amp;nbsp;&lt;a href=&quot;http://stackoverflow.com/questions/4709137/solution-android-install-failed-insufficient-storage-error&quot;&gt;http://stackoverflow.com/questions/4709137/solution-android-install-failed-insufficient-storage-error&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Getting this error:&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;[2011-07-01 10:36:22 - MDatHand] Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;[2011-07-01 10:36:22 - MDatHand] Please check logcat output for more details.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;[2011-07-01 10:36:22 - MDatHand] Launch canceled!&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;I used this solution:&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: collapse; line-height: 18px;&quot;&gt;RIGHT CLICK the root of your Android Project&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: collapse; line-height: 18px;&quot;&gt;SELECT &quot;Run As&quot; then go to &quot;Run Configurations...&quot;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: collapse; line-height: 18px;&quot;&gt;LOCATE the &quot;Android Application&quot; node in the tree at the left then&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: collapse; font-family: &#39;Trebuchet MS&#39;, sans-serif; line-height: 18px;&quot;&gt;SELECT your project&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: collapse; font-family: &#39;Trebuchet MS&#39;, sans-serif; line-height: 18px;&quot;&gt;SELECT &quot;Target&quot; tab on the right side of the window look down for the &quot;Additional Emulator Command Line Options&quot; field (sometimes you&#39;ll need to make the window larger)&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: collapse; font-family: &#39;Trebuchet MS&#39;, sans-serif; line-height: 18px;&quot;&gt;PASTE &quot;-partition-size 1024&quot; there&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: collapse; font-family: &#39;Trebuchet MS&#39;, sans-serif; line-height: 18px;&quot;&gt;CLICK &quot;Apply&quot; and then Run to use your emulator&lt;/span&gt;&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEichzux3d8uLtTuOGNIsD7BEDQhcybf3xh2BAqbhd1l9fD3vczCPmaUOSXCj3h5R1RuNP4gTHr64peBpCJFc5iFHdk0NwyR5T9GfsyvS8cUyZPbazd402ySHaru3VkOvB2Xj_3EQqDh6lkT/s1600/20110701_screenshot01.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;311&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEichzux3d8uLtTuOGNIsD7BEDQhcybf3xh2BAqbhd1l9fD3vczCPmaUOSXCj3h5R1RuNP4gTHr64peBpCJFc5iFHdk0NwyR5T9GfsyvS8cUyZPbazd402ySHaru3VkOvB2Xj_3EQqDh6lkT/s320/20110701_screenshot01.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Like so.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: collapse; font-family: &#39;Trebuchet MS&#39;, sans-serif; line-height: 18px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: collapse; font-family: &#39;Trebuchet MS&#39;, sans-serif; font-size: x-small; line-height: 18px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidgeisha.blogspot.com/feeds/8662819134388967112/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidgeisha.blogspot.com/2011/07/solution-to-installation-error.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5834825895105257420/posts/default/8662819134388967112'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5834825895105257420/posts/default/8662819134388967112'/><link rel='alternate' type='text/html' href='http://androidgeisha.blogspot.com/2011/07/solution-to-installation-error.html' title='Solution to &quot;Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE&quot;'/><author><name>HappyGeisha</name><uri>http://www.blogger.com/profile/00311271943841904211</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/AVvXsEichzux3d8uLtTuOGNIsD7BEDQhcybf3xh2BAqbhd1l9fD3vczCPmaUOSXCj3h5R1RuNP4gTHr64peBpCJFc5iFHdk0NwyR5T9GfsyvS8cUyZPbazd402ySHaru3VkOvB2Xj_3EQqDh6lkT/s72-c/20110701_screenshot01.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5834825895105257420.post-4075578456706684821</id><published>2011-06-23T12:31:00.000-07:00</published><updated>2012-06-06T07:50:48.243-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Fixing Errors"/><title type='text'>“Debug certificate expired” Error in Eclipse</title><content type='html'>When there is no error in the code, but for some reason the project says there is an error and prevents you from running...&lt;br /&gt;
&lt;br /&gt;
When you&#39;ve torn your hair out trying to delete and re-import your project files to no avail...&lt;br /&gt;
&lt;br /&gt;
When you&#39;ve &quot;cleaned&quot; and &quot;fixed project properties&quot; so many times your index fingertip is bleeding...&lt;br /&gt;
&lt;br /&gt;
Try looking at your project problems ( Window &amp;gt; Show View &amp;gt; Problems )&lt;br /&gt;
&lt;br /&gt;
You might get something that looks like this:&lt;br /&gt;
Debug Certificate Expired...&lt;br /&gt;
&lt;br /&gt;
If the above has happened to you, then I have a fix for you! You can probably solve this problem by deleting the debug certificate file. (Eclipse will then build a new one, and the error will go away.)&lt;br /&gt;
&lt;br /&gt;
Win 7 OS: Go to ( Window &amp;gt; Preferences &amp;gt; Android &amp;gt; Build ) and find out where the debug.keystore file is located on your hard drive. Then using file explorer, find it and destroy it.&lt;br /&gt;
&lt;br /&gt;
Thats it. Import your projects or whatever, do a clean and the error should disappear.&lt;br /&gt;
&lt;br /&gt;
References:&lt;br /&gt;
&lt;a href=&quot;http://stackoverflow.com/questions/2194808/debug-certificate-expired-error-in-eclipse-android-plugins&quot;&gt;http://stackoverflow.com/questions/2194808/debug-certificate-expired-error-in-eclipse-android-plugins&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidgeisha.blogspot.com/feeds/4075578456706684821/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidgeisha.blogspot.com/2011/06/debug-certificate-expired-error-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5834825895105257420/posts/default/4075578456706684821'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5834825895105257420/posts/default/4075578456706684821'/><link rel='alternate' type='text/html' href='http://androidgeisha.blogspot.com/2011/06/debug-certificate-expired-error-in.html' title='“Debug certificate expired” Error in Eclipse'/><author><name>HappyGeisha</name><uri>http://www.blogger.com/profile/00311271943841904211</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-5834825895105257420.post-8819676226529485679</id><published>2011-06-08T13:41:00.000-07:00</published><updated>2012-06-06T07:48:08.611-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Custom Design"/><category scheme="http://www.blogger.com/atom/ns#" term="List View"/><title type='text'>So you need to change the text size of simple_list_item_single_choice...</title><content type='html'>I feel you.&lt;br /&gt;
&lt;br /&gt;
I tried for a month straight to call the checkedtextview in the android standard layout and resize the text. It never let me. I felt like a idiot. And now that I&#39;ve figured it out, I know that it is more than just a feeling.&lt;br /&gt;
&lt;br /&gt;
And so I&#39;m posting it here, in the event that I actually forget how to do this later on. Because.. you know... I&#39;m an idiot.&lt;br /&gt;
&lt;br /&gt;
I went and copied the xml from the api demo and pasted it into a new .xml file(step 1). I accessed the text size and adjusted it thusly (step 2). Then I changed the java code to replace the simple_list_item_single_choice with my own custom row layout (step 3). Facepalmed for about two hours (step 4).&lt;br /&gt;
&lt;br /&gt;
my_listitem_singlechoice.xml (i just chaged &quot;textAppearance&quot; attribute but I&#39;m sure you can do other stuff to it too) :&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&amp;lt;CheckedTextView xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp; &amp;nbsp; android:id=&quot;@android:id/text1&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp; &amp;nbsp; android:layout_width=&quot;match_parent&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp; &amp;nbsp; android:layout_height=&quot;?android:attr/listPreferredItemHeight&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp; &amp;nbsp; android:textAppearance=&quot;?android:attr/textAppearanceSmall&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp; &amp;nbsp; android:gravity=&quot;center_vertical&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp; &amp;nbsp; android:checkMark=&quot;?android:attr/listChoiceIndicatorSingle&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp; &amp;nbsp; android:paddingLeft=&quot;6dip&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp; &amp;nbsp; android:paddingRight=&quot;6dip&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
my_java_with_singlechoice.java (this should look somewhat familiar) :&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;ListView lv = this.getListView();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;MyListAdapter = new ArrayAdapter&amp;lt;String&amp;gt;(this,&amp;nbsp;R.layout.my_listitem_singlechoice, myArrayList);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;lv.setAdapter(MyListAdapter&amp;nbsp;);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;lv.setChoiceMode(ListView.CHOICE_MODE_SINGLE);&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidgeisha.blogspot.com/feeds/8819676226529485679/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidgeisha.blogspot.com/2011/06/so-you-need-to-change-text-size-of.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5834825895105257420/posts/default/8819676226529485679'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5834825895105257420/posts/default/8819676226529485679'/><link rel='alternate' type='text/html' href='http://androidgeisha.blogspot.com/2011/06/so-you-need-to-change-text-size-of.html' title='So you need to change the text size of simple_list_item_single_choice...'/><author><name>HappyGeisha</name><uri>http://www.blogger.com/profile/00311271943841904211</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-5834825895105257420.post-5972178766690935290</id><published>2011-04-27T10:42:00.000-07:00</published><updated>2012-06-06T07:49:06.815-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Database"/><category scheme="http://www.blogger.com/atom/ns#" term="SQLite"/><title type='text'>Getting Your Big Ass Database onto Your Android Phone</title><content type='html'>Yeah, I effing did it!!!!!!!!!! (Sorry, still pumped from finally getting this to work.)&lt;br /&gt;
&lt;br /&gt;
First off: giving credit where credit is due. Many many many thanks to my sources:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/&quot;&gt;http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.mail-archive.com/android-developers@googlegroups.com/msg28194.html&quot;&gt;http://www.mail-archive.com/android-developers@googlegroups.com/msg28194.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.chriskopec.com/blog/2010/mar/13/deploying-android-apps-with-large-databases/&quot;&gt;http://www.chriskopec.com/blog/2010/mar/13/deploying-android-apps-with-large-databases/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
My project requires a preformed database (SQLite), which in total comes out to a whopping 17mb.&amp;nbsp;Ridiculous&amp;nbsp;I know, but my boss wants it all packaged with the app, and not just to be available online. Hypothetically, getting this to work should be as easy as creating a blank db and then copying the existing one over it from assets or raw. And this totally works-- if your db is smaller than 1mb. So I went and got some free file splitting software (&lt;a href=&quot;http://www.dekabyte.com/filesplitter/&quot;&gt;http://www.dekabyte.com/filesplitter/&lt;/a&gt;) and split my db file into 1mb pieces. I put the pieces in the raw directory.&lt;br /&gt;
&lt;br /&gt;
I created the DataBaseHelper class and made the necessary tweaks:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;public class DataBaseHelper extends SQLiteOpenHelper {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;// The Android&#39;s default system path of your application database.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private static final String DB_PATH = &quot;/data/data/com.instacare/databases/&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private static final String DB_NAME = &quot;MDAtHand&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private SQLiteDatabase myDataBase;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private final Context myContext;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Resources resources;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;/**&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; * Constructor Takes and keeps a reference of the passed context in order to&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; * access to the application assets and resources.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; *&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; * @param context&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; */&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public DataBaseHelper(Context context) {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;super(context, DB_NAME, null, 1);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;this.myContext = context;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// super(context, DB_NAME, null, 1);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;resources = context.getResources();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;/**&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; * Creates a empty database on the system and rewrites it with your own&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; * database.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; * */&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public void createDataBase() throws IOException {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;boolean dbExist = checkDataBase();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;if (dbExist) {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;// do nothing - database already exist&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt; copyDataBase();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;} else {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;// By calling this method and empty database will be created into&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;// the default system path&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;// of your application so we are gonna be able to overwrite that&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;// database with our database.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;this.getReadableDatabase();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;try {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;copyDataBase();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;} catch (IOException e) {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;throw new Error(&quot;Error copying database&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;/**&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; * Check if the database already exist to avoid re-copying the file each&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; * time you open the application.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; *&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; * @return true if it exists, false if it doesn&#39;t&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; */&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private boolean checkDataBase() {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;SQLiteDatabase checkDB = null;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;try {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;String myPath = DB_PATH + DB_NAME;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;checkDB = SQLiteDatabase.openDatabase(myPath, null,&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;SQLiteDatabase.OPEN_READONLY);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;} catch (SQLiteException e) {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;// database does&#39;t exist yet.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;if (checkDB != null) {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;checkDB.close();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;return checkDB != null ? true : false;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;/**&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; * Copies your database from your local assets-folder to the just created&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; * empty database in the system folder, from where it can be accessed and&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; * handled. This is done by transfering bytestream.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; * */&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private void copyDataBase() throws IOException {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// Open your local db as the input stream&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// InputStream myInput = myContext.getAssets().open(DB_NAME);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// Path to the just created empty db&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// String outFileName = DB_PATH + DB_NAME;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// Open the empty db as the output stream&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// OutputStream myOutput = new FileOutputStream(outFileName);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// transfer bytes from the inputfile to the outputfile&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// byte[] buffer = new byte[1024];&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// int length;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// while ((length = myInput.read(buffer))&amp;gt;0){&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// myOutput.write(buffer, 0, length);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// }&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// Close the streams&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// myOutput.flush();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// myOutput.close();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// myInput.close();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;InputStream databaseInput = null;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// String outFileName = DB_PATH + DbConsts.DATABASE_NAME;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;String outFileName = DB_PATH + DB_NAME;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;OutputStream databaseOutput = new FileOutputStream(outFileName);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;byte[] buffer = new byte[1024];&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;int length;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;databaseInput = resources.openRawResource(R.raw.datafile01);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;while ((length = databaseInput.read(buffer)) &amp;gt; 0) {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;databaseOutput.write(buffer, 0, length);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;databaseOutput.flush();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;databaseInput.close();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;databaseInput = resources.openRawResource(R.raw.datafile02);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;while((length = databaseInput.read(buffer)) &amp;gt; 0) {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&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;databaseOutput.write(buffer, 0, length);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&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;databaseOutput.flush();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;databaseInput.close();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;databaseInput = resources.openRawResource(R.raw.datafile03);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;while((length = databaseInput.read(buffer)) &amp;gt; 0) {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&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;databaseOutput.write(buffer, 0, length);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&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;databaseOutput.flush();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;databaseInput.close();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;databaseInput = resources.openRawResource(R.raw.datafile04);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;while((length = databaseInput.read(buffer)) &amp;gt; 0) {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&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;databaseOutput.write(buffer, 0, length);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&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;databaseOutput.flush();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;databaseInput.close();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;databaseInput = resources.openRawResource(R.raw.datafile05);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;while((length = databaseInput.read(buffer)) &amp;gt; 0) {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&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;databaseOutput.write(buffer, 0, length);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&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;databaseOutput.flush();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;databaseInput.close();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;databaseInput = resources.openRawResource(R.raw.datafile06);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;while((length = databaseInput.read(buffer)) &amp;gt; 0) {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&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;databaseOutput.write(buffer, 0, length);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&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;databaseOutput.flush();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;databaseInput.close();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;databaseInput = resources.openRawResource(R.raw.datafile07);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;while((length = databaseInput.read(buffer)) &amp;gt; 0) {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&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;databaseOutput.write(buffer, 0, length);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&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;databaseOutput.flush();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;databaseInput.close();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;databaseInput = resources.openRawResource(R.raw.datafile08);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;while((length = databaseInput.read(buffer)) &amp;gt; 0) {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&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;databaseOutput.write(buffer, 0, length);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&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;databaseOutput.flush();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;databaseInput.close();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;databaseInput = resources.openRawResource(R.raw.datafile09);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;while((length = databaseInput.read(buffer)) &amp;gt; 0) {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&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;databaseOutput.write(buffer, 0, length);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&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;databaseOutput.flush();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;databaseInput.close();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;databaseInput = resources.openRawResource(R.raw.datafile10);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;while((length = databaseInput.read(buffer)) &amp;gt; 0) {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&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;databaseOutput.write(buffer, 0, length);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&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;databaseOutput.flush();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;databaseInput.close();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;databaseInput = resources.openRawResource(R.raw.datafile11);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;while((length = databaseInput.read(buffer)) &amp;gt; 0) {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&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;databaseOutput.write(buffer, 0, length);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&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;databaseOutput.flush();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;databaseInput.close();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;databaseInput = resources.openRawResource(R.raw.datafile12);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;while((length = databaseInput.read(buffer)) &amp;gt; 0) {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&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;databaseOutput.write(buffer, 0, length);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&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;databaseOutput.flush();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;databaseInput.close();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;databaseInput = resources.openRawResource(R.raw.datafile13);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;while((length = databaseInput.read(buffer)) &amp;gt; 0) {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&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;databaseOutput.write(buffer, 0, length);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&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;databaseOutput.flush();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;databaseInput.close();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;databaseInput = resources.openRawResource(R.raw.datafile14);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;while((length = databaseInput.read(buffer)) &amp;gt; 0) {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&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;databaseOutput.write(buffer, 0, length);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&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;databaseOutput.flush();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;databaseInput.close();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;databaseInput = resources.openRawResource(R.raw.datafile15);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;while((length = databaseInput.read(buffer)) &amp;gt; 0) {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&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;databaseOutput.write(buffer, 0, length);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&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;databaseOutput.flush();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;databaseInput.close();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;databaseInput = resources.openRawResource(R.raw.datafile16);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;while((length = databaseInput.read(buffer)) &amp;gt; 0) {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&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;databaseOutput.write(buffer, 0, length);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&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;databaseOutput.flush();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;databaseInput.close();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;databaseInput = resources.openRawResource(R.raw.datafile17);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;while((length = databaseInput.read(buffer)) &amp;gt; 0) {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&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;databaseOutput.write(buffer, 0, length);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&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;databaseOutput.flush();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;databaseInput.close();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;databaseOutput.flush();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;databaseOutput.close();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public void openDataBase() throws SQLException {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// Open the database&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;String myPath = DB_PATH + DB_NAME;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;myDataBase = SQLiteDatabase.openDatabase(myPath, null,&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;SQLiteDatabase.OPEN_READONLY);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;@Override&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public synchronized void close() {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;if (myDataBase != null)&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;myDataBase.close();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;super.close();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;@Override&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public void onCreate(SQLiteDatabase db) {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;@Override&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;// Add your public helper methods to access and get content from the&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;// database.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;// You could return cursors by doing &quot;return myDataBase.query(....)&quot; so it&#39;d&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;// be easy&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;// to you to create adapters for your views.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Then I added this awesomeness to the main.java file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;DataBaseHelper myDbHelper = new DataBaseHelper(this);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//myDbHelper = new DataBaseHelper(this);&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;try {&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&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;myDbHelper.createDataBase();&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;} catch (IOException ioe) {&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;throw new Error(&quot;Unable to create database&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;try {&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;myDbHelper.openDataBase();&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}catch(SQLException sqle){&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;throw sqle;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
Thats it :)</content><link rel='replies' type='application/atom+xml' href='http://androidgeisha.blogspot.com/feeds/5972178766690935290/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidgeisha.blogspot.com/2011/04/getting-your-big-ass-database-onto-your.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5834825895105257420/posts/default/5972178766690935290'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5834825895105257420/posts/default/5972178766690935290'/><link rel='alternate' type='text/html' href='http://androidgeisha.blogspot.com/2011/04/getting-your-big-ass-database-onto-your.html' title='Getting Your Big Ass Database onto Your Android Phone'/><author><name>HappyGeisha</name><uri>http://www.blogger.com/profile/00311271943841904211</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-5834825895105257420.post-7210891378714489975</id><published>2011-02-09T07:41:00.000-08:00</published><updated>2012-06-06T07:46:22.230-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="List View"/><title type='text'>Deleting Single Choice Listview Items</title><content type='html'>This post assumes&amp;nbsp;you know how to create a single choice listview and a button in xml.&lt;br /&gt;
&lt;br /&gt;
1) First, define these three variables:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;public static List&amp;lt;String&amp;gt; strings;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; public static ListAdapter adapter;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; ListView lv;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
2) Next, set up the listview in onCreate:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;strings = new ArrayList&amp;lt;String&amp;gt;();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; lv = getListView();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; adapter = new ArrayAdapter&amp;lt;String&amp;gt;(this,android.R.layout.simple_list_item_single_choice, strings);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; lv.setChoiceMode(ListView.CHOICE_MODE_SINGLE);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; lv.setAdapter(adapter);&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
google_ad_client = &quot;ca-pub-0203000218086978&quot;;
/* Mid-Post */
google_ad_slot = &quot;0253944060&quot;;
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;

&lt;br /&gt;
&lt;br /&gt;
3) Last, set up the delete button:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;Button btnRemove = (Button) findViewById(R.id.ButtonEditLabOrderForm_Remove);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; btnRemove.setOnClickListener(new View.OnClickListener() {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;@SuppressWarnings(&quot;unchecked&quot;)&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public void onClick(View v) {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Code below only works with ONE CHECKED ITEM at a time&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int len = lv.getCount();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;SparseBooleanArray checked = lv.getCheckedItemPositions();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;for (int i = 0; i &amp;lt; len; i++)&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;if (checked.get(i)) {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;String item = strings.get(i);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;// do whatever you want with the checked item&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;strings.remove(item);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;((ArrayAdapter&amp;lt;String&amp;gt;) adapter).notifyDataSetChanged();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&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;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; });&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Thats it !&lt;br /&gt;
&lt;br /&gt;
Still trying to figure out how to delete multiple items in a multiple choice list :(&lt;br /&gt;
&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
google_ad_client = &quot;ca-pub-0203000218086978&quot;;
/* Mid-Post */
google_ad_slot = &quot;0253944060&quot;;
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidgeisha.blogspot.com/feeds/7210891378714489975/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidgeisha.blogspot.com/2011/02/deleting-single-choice-listview-items.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5834825895105257420/posts/default/7210891378714489975'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5834825895105257420/posts/default/7210891378714489975'/><link rel='alternate' type='text/html' href='http://androidgeisha.blogspot.com/2011/02/deleting-single-choice-listview-items.html' title='Deleting Single Choice Listview Items'/><author><name>HappyGeisha</name><uri>http://www.blogger.com/profile/00311271943841904211</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-5834825895105257420.post-5790692414317476713</id><published>2011-02-01T12:37:00.000-08:00</published><updated>2012-06-06T07:49:34.850-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Custom Design"/><title type='text'>Button with Image and Text</title><content type='html'>This all goes down in the XML file with the button in question. This can also be accomplished dynamically (not shown.) Here is the&amp;nbsp;excerpt&amp;nbsp;from the xml file defining the button. The image should be located in the drawable folder. The image is called from &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;android:drawable&lt;/span&gt;. Use &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;drawableLeft&lt;/span&gt;, &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;drawableRight&lt;/span&gt;, &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;drawableTop&lt;/span&gt;, &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;drawableBottom &lt;/span&gt;depending on how you want to place the image in relation to the text. Adjust the padding to suit your aesthetic.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&amp;lt;Button&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;android:layout_width=&quot;wrap_content&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;android:text=&quot;Sample Text&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;android:id=&quot;@+id/Button01&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;android:layout_height=&quot;wrap_content&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;android:drawableLeft=&quot;@drawable/search&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;android:drawablePadding=&quot;0px&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;android:padding=&quot;0px&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&amp;lt;/Button&amp;gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidgeisha.blogspot.com/feeds/5790692414317476713/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidgeisha.blogspot.com/2011/02/button-with-image-and-text.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5834825895105257420/posts/default/5790692414317476713'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5834825895105257420/posts/default/5790692414317476713'/><link rel='alternate' type='text/html' href='http://androidgeisha.blogspot.com/2011/02/button-with-image-and-text.html' title='Button with Image and Text'/><author><name>HappyGeisha</name><uri>http://www.blogger.com/profile/00311271943841904211</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-5834825895105257420.post-5139020728865717195</id><published>2011-01-28T09:01:00.000-08:00</published><updated>2012-06-06T07:48:08.598-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Custom Design"/><category scheme="http://www.blogger.com/atom/ns#" term="Spinner"/><title type='text'>Custom Spinner Row Layout &amp; Custom Spinner Adapter</title><content type='html'>The custom spinner adapter is similar to the custom list row &amp;amp; adapter, because we can use LayoutInflater.&lt;br /&gt;
&lt;br /&gt;
(*edit: This code may not run as-is. Therefore, I have included project files associated with this post available for download at the end of this post.)&lt;br /&gt;
&lt;br /&gt;
1) The spinner layout. This is how each row will look when the spinner is selected. In my example there are three text views as three rows.&lt;br /&gt;
&lt;br /&gt;

&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;lt;LinearLayout&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; android:layout_width=&quot;fill_parent&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; android:layout_height=&quot;fill_parent&quot; android:orientation=&quot;vertical&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;TextView&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:layout_height=&quot;wrap_content&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:id=&quot;@+id/TextView01&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:textSize=&quot;12px&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:layout_width=&quot;match_parent&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:textColor=&quot;#000000&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/TextView&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;TextView&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:layout_height=&quot;wrap_content&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:id=&quot;@+id/TextView02&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:layout_width=&quot;match_parent&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:textSize=&quot;12px&quot; android:textColor=&quot;#000000&quot;&amp;gt;&amp;lt;/TextView&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;TextView&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:layout_height=&quot;wrap_content&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:id=&quot;@+id/TextView03&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:layout_width=&quot;match_parent&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:textSize=&quot;12px&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android:textColor=&quot;#000000&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/TextView&amp;gt;&lt;br /&gt;
&amp;lt;/LinearLayout&amp;gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;


&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--
google_ad_client = &quot;ca-pub-0203000218086978&quot;;
/* Mid-Post */
google_ad_slot = &quot;0253944060&quot;;
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;
src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;
&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;

2) The custom adapter&lt;br /&gt;


&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;
// CUSTOM SPINNER ADAPTER&lt;br /&gt;
public class MyCustomSpinnerAdapter extends ArrayAdapter&amp;lt;String&amp;gt; {&lt;br /&gt;
&lt;br /&gt;
public MyCustomSpinnerAdapter(Context context, int textViewResourceId,&lt;br /&gt;
String[] objects) {&lt;br /&gt;
super(context, textViewResourceId, objects);&lt;br /&gt;
// TODO Auto-generated constructor stub&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
@Override&lt;br /&gt;
public View getDropDownView(int position, View convertView, ViewGroup parent) {&lt;br /&gt;
// TODO Auto-generated method stub&lt;br /&gt;
return getCustomView(position, convertView, parent);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
@Override&lt;br /&gt;
public View getView(int position, View convertView, ViewGroup parent) {&lt;br /&gt;
// TODO Auto-generated method stub&lt;br /&gt;
return getCustomView(position, convertView, parent);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
public View getCustomView(int position, View convertView,ViewGroup parent) {&lt;br /&gt;
// TODO Auto-generated method stub&lt;br /&gt;
// return super.getView(position, convertView, parent);&lt;br /&gt;
&lt;br /&gt;
LayoutInflater inflater = getLayoutInflater();&lt;br /&gt;
&lt;br /&gt;
ViewHolder holder;&lt;br /&gt;
if (convertView == null) {&lt;br /&gt;
convertView = inflater.inflate(R.layout.customspinneritem, null);&lt;br /&gt;
holder = new ViewHolder();&lt;br /&gt;
holder.txt01 = (TextView) convertView.findViewById(R.id.TextView01);&lt;br /&gt;
holder.txt02 = (TextView) convertView.findViewById(R.id.TextView02);&lt;br /&gt;
holder.txt03 = (TextView) convertView.findViewById(R.id.TextView03);&lt;br /&gt;
&lt;br /&gt;
convertView.setTag(holder);&lt;br /&gt;
&lt;br /&gt;
} else {&lt;br /&gt;
&lt;br /&gt;
holder = (ViewHolder) convertView.getTag();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
holder.txt01.setText(&quot;Route&quot;)&lt;br /&gt;
holder.txt02.setText(&quot;Strength&quot;);&lt;br /&gt;
holder.txt03.setText(&quot;Form&quot;);&lt;br /&gt;
&lt;br /&gt;
return convertView;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
class ViewHolder {&lt;br /&gt;
TextView txt01;&lt;br /&gt;
TextView txt02;&lt;br /&gt;
TextView txt03;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
} // end custom adapter&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
3) Calling the spinner &amp;amp; setting the adapter&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;
Spinner spinner = (Spinner) findViewById(R.id.spinner1);&lt;br /&gt;
spinner.setPrompt(&quot;Select One&quot;);&lt;br /&gt;
spinner.setAdapter(new MyCustomSpinnerAdapter(this, 0, items));&lt;br /&gt;
spinner.setOnItemSelectedListener(new OnItemSelectedListener() {&lt;br /&gt;
@Override&lt;br /&gt;
public void onItemSelected(AdapterView&amp;lt;?&amp;gt; parentView, View selectedItemView, int position, long id) {&lt;br /&gt;
// your code here&lt;br /&gt;
}&lt;br /&gt;&lt;br /&gt;
@Override&lt;br /&gt;
&gt;public void onNothingSelected(AdapterView&amp;lt;?&amp;gt; parentView) {&lt;br /&gt;
// your code here&lt;br /&gt;
}&lt;br /&gt;
});&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
4) Setting string items&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;
String[] items = { &quot;Route 1, Strength 1, Form 1&quot;, &quot;Route 2, Strength 2, Form 2&quot;, &quot;Route 3, Strength 3, Form 3&quot; };&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Downloads:&lt;br /&gt;
&lt;a href=&quot;http://mskimee.altervista.org/AndroidGeisha/CustomSpinner1/CustomSpinner/res/layout/main.xml&quot; target=&quot;_blank&quot;&gt;main.xml&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://mskimee.altervista.org/AndroidGeisha/CustomSpinner1/CustomSpinner/res/layout/customspinneritem.xml&quot; target=&quot;_blank&quot;&gt;customspinneritem.xml&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://mskimee.altervista.org/AndroidGeisha/CustomSpinner1/CustomSpinner/src/androidgeisha/example/spinner/CustomSpinnerActivity.java&quot; target=&quot;_blank&quot;&gt;CustomSpinnerActivity.java&lt;/a&gt;&amp;nbsp;(select &quot;qui&quot;)&lt;br /&gt;
&lt;br /&gt;
Resources:&lt;br /&gt;
&lt;a href=&quot;http://androidgeisha.blogspot.com/2011/01/simple-spinner-w-array-adapter.html&quot; target=&quot;_blank&quot;&gt;My previous Spinner post&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://developer.android.com/resources/tutorials/views/hello-spinner.html&quot; target=&quot;_blank&quot;&gt;Android Dev Tutorial - Hello Spinner&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://androidgeisha.blogspot.com/2011/01/seriously-this-is-how-i-made-list-item.html&quot; target=&quot;_blank&quot;&gt;Custom List Row Layout w/ Adapter&lt;/a&gt;&lt;br/&gt;&lt;br /&gt;

&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--
google_ad_client = &quot;ca-pub-0203000218086978&quot;;
/* Mid-Post */
google_ad_slot = &quot;0253944060&quot;;
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;
src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidgeisha.blogspot.com/feeds/5139020728865717195/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidgeisha.blogspot.com/2011/01/custom-spinner-row-layout-custom.html#comment-form' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5834825895105257420/posts/default/5139020728865717195'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5834825895105257420/posts/default/5139020728865717195'/><link rel='alternate' type='text/html' href='http://androidgeisha.blogspot.com/2011/01/custom-spinner-row-layout-custom.html' title='Custom Spinner Row Layout &amp; Custom Spinner Adapter'/><author><name>HappyGeisha</name><uri>http://www.blogger.com/profile/00311271943841904211</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>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5834825895105257420.post-3876718354104074573</id><published>2011-01-28T08:13:00.000-08:00</published><updated>2012-06-06T07:47:06.629-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Spinner"/><title type='text'>Simple Spinner w/ Array Adapter</title><content type='html'>Very basic stuff here, people. If you haven&#39;t yet, &lt;a href=&quot;http://developer.android.com/resources/tutorials/views/hello-spinner.html&quot; target=&quot;_blank&quot;&gt;get&amp;nbsp;acquainted&amp;nbsp;with android spinner using the dev tutorial&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) Calling the spinner, defining the array adapter.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;Spinner spinner= (Spinner) findViewById(R.id.spinner);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; ArrayAdapter&amp;lt;String&amp;gt; spinnerArrayAdapter = new ArrayAdapter&amp;lt;String&amp;gt;(&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; this, android.R.layout.simple_spinner_item, items);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; spinnerArrayAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;spinner.setPrompt(&quot;Select One&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;spinner.setAdapter(spinnerArrayAdapter&amp;nbsp;);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;spnRoute.setOnItemSelectedListener(new OnItemSelectedListener() {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;@Override&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;public void onItemSelected(AdapterView&amp;lt;?&amp;gt; parentView,&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;View selectedItemView, int position, long id) {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;// your code here&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;@Override&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;public void onNothingSelected(AdapterView&amp;lt;?&amp;gt; parentView) {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;// your code here&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;});&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
2) The string array&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;String[] items = { &quot;lorem&quot;, &quot;ipsum&quot;, &quot;dolor&quot;, &quot;sit&quot;, &quot;amet&quot;};&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidgeisha.blogspot.com/feeds/3876718354104074573/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidgeisha.blogspot.com/2011/01/simple-spinner-w-array-adapter.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5834825895105257420/posts/default/3876718354104074573'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5834825895105257420/posts/default/3876718354104074573'/><link rel='alternate' type='text/html' href='http://androidgeisha.blogspot.com/2011/01/simple-spinner-w-array-adapter.html' title='Simple Spinner w/ Array Adapter'/><author><name>HappyGeisha</name><uri>http://www.blogger.com/profile/00311271943841904211</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-5834825895105257420.post-1399989570662301515</id><published>2011-01-14T10:37:00.000-08:00</published><updated>2012-10-18T09:16:04.667-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Custom Design"/><category scheme="http://www.blogger.com/atom/ns#" term="List View"/><title type='text'>Seriously, this is how I made a multi-column list item populated by strings!!</title><content type='html'>&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;title&gt;Untitled Document&lt;/title&gt;
&lt;/head&gt;

&lt;body&gt;


&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;1) The item layout:&lt;/span&gt;&lt;br/&gt;
&lt;br/&gt;

&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;
&amp;lt;LinearLayout&lt;br /&gt;
xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&lt;br /&gt;android:id=&quot;@+id/LinearLayout01&quot;&lt;br /&gt;
android:layout_alignParentLeft=&quot;true&quot;&lt;br /&gt;
android:layout_height=&quot;fill_parent&quot;&lt;br /&gt;
android:orientation=&quot;vertical&quot;&lt;br /&gt;
android:layout_width=&quot;fill_parent&quot;&amp;gt;&lt;br /&gt;
&amp;lt;TextView&lt;br /&gt;
android:layout_height=&quot;wrap_content&quot;&lt;br /&gt;
android:id=&quot;@+id/TextView_Title&quot;&lt;br /&gt;
android:text=&quot;Title&quot;&lt;br /&gt;
android:textSize=&quot;15px&quot;&lt;br /&gt;
android:layout_width=&quot;fill_parent&quot;&amp;gt;&amp;lt;/TextView&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;LinearLayout&lt;br /&gt;
android:id=&quot;@+id/LinearLayout02&quot;&lt;br /&gt;
android:layout_width=&quot;fill_parent&quot;&lt;br /&gt;
android:layout_height=&quot;wrap_content&quot;&amp;gt;&lt;br /&gt;
&amp;lt;TextView&lt;br /&gt;
android:layout_height=&quot;wrap_content&quot;&lt;br /&gt;
android:id=&quot;@+id/TextView_Item1&quot;&lt;br /&gt;
android:text=&quot;Item1&quot;&lt;br /&gt;
android:layout_width=&quot;wrap_content&quot;&lt;br /&gt;
android:textSize=&quot;10px&quot; android:layout_weight=&quot;1&quot;/&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;TextView&lt;br /&gt;
android:layout_height=&quot;wrap_content&quot;&lt;br /&gt;
android:id=&quot;@+id/TextView_Item2&quot;&lt;br /&gt;
android:text=&quot;Item2&quot;&lt;br /&gt;
android:layout_width=&quot;wrap_content&quot;&lt;br /&gt;
android:textSize=&quot;10px&quot; android:layout_weight=&quot;1&quot;/&amp;gt;&lt;br /&gt;
&amp;lt;TextView&lt;br /&gt;
android:layout_height=&quot;wrap_content&quot;&lt;br /&gt;
android:id=&quot;@+id/TextView_Item3&quot;&lt;br /&gt;
android:text=&quot;Item3&quot;&lt;br /&gt;
android:layout_width=&quot;wrap_content&quot;&lt;br /&gt;
android:textSize=&quot;10px&quot; android:layout_weight=&quot;1&quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/LinearLayout&amp;gt;&lt;br /&gt;
&amp;lt;/LinearLayout&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--
google_ad_client = &quot;ca-pub-0203000218086978&quot;;
/* Mid-Post */
google_ad_slot = &quot;0253944060&quot;;
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;
src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;
&lt;/script&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;2) Build the custom adapter:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;// CUSTOM TWO ROW LIST ADAPTER&lt;br /&gt;
static class EfficientAdapter extends BaseAdapter {&lt;br /&gt;
private LayoutInflater mInflater;&lt;br /&gt;
&lt;br /&gt;
public EfficientAdapter(Context context) {&lt;br /&gt;
mInflater = LayoutInflater.from(context);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
public int getCount() {&lt;br /&gt;
return title.size();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
public Object getItem(int position) {&lt;br /&gt;
return position;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
public long getItemId(int position) {&lt;br /&gt;
return position;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
public View getView(int position, View convertView, ViewGroup parent) {&lt;br /&gt;
ViewHolder holder;&lt;br /&gt;
if (convertView == null) {&lt;br /&gt;
convertView = mInflater.inflate(R.layout.listitem_addrx, null);&lt;br /&gt;
holder = new ViewHolder();&lt;br /&gt;
holder.txtTitle = (TextView) convertView.findViewById(R.id.TextView_Title);&lt;br /&gt;
holder.txtItem1 = (TextView) convertView.findViewById(R.id.TextView_Item1);&lt;br /&gt;holder.txtItem2 = (TextView) convertView.findViewById(R.id.TextView_Item2);&lt;br /&gt;
holder.txtItem3 = (TextView) convertView.findViewById(R.id.TextView_Item3);&lt;br /&gt;
&lt;br /&gt;
convertView.setTag(holder);&lt;br /&gt;
holder = (ViewHolder) convertView.getTag();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
holder.txtTitle.setText(title.get(position));&lt;br /&gt;
holder.txtItem1.setText(one.get(position));&lt;br /&gt;
holder.txtItem2.setText(two.get(position));&lt;br /&gt;
holder.txtItem3.setText(three.get(position));&lt;br /&gt;
&lt;br /&gt;
return convertView;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
static class ViewHolder {&lt;br /&gt;
TextView txtTitle;&lt;br /&gt;
TextView&amp;nbsp;txtItem1;&lt;br /&gt;
TextView&amp;nbsp;txtItem2;&lt;br /&gt;
TextView&amp;nbsp;txtItem3;&lt;br /&gt;
}&lt;br /&gt;
} // end custom adapter&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;3) Call the following items:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;color: #0b5394;&quot;&gt;static ListView lv;&lt;br /&gt;
public static ListAdapter adapter;&lt;br /&gt;String selected;&lt;br /&gt;
static final ArrayList&amp;lt;String&amp;gt; title = new ArrayList&amp;lt;String&amp;gt;();&lt;br /&gt;
static final ArrayList&amp;lt;String&amp;gt; one = new ArrayList&amp;lt;String&amp;gt;();&lt;br /&gt;
static final ArrayList&amp;lt;String&amp;gt; two = new ArrayList&amp;lt;String&amp;gt;();&lt;br /&gt;
static final ArrayList&amp;lt;String&amp;gt; three = new ArrayList&amp;lt;String&amp;gt;();&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;
4) Set the list adapter:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;color: #0b5394;&quot;&gt;lv = (ListView) getListView();&lt;br/&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;lv.setAdapter(new EfficientAdapter(this));&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;5) Add entries to list:&lt;br /&gt;&lt;br /&gt;
Either define a string array when you call the variables in step 3 or add items dynamically:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;color: #0b5394;&quot;&gt;title.add(selected);&lt;br /&gt;
 route.add(selected);&lt;br /&gt;
  strength.add(selected);&lt;br /&gt;
   form.add(selected);&lt;br /&gt;
   &lt;br /&gt;
    lv.setAdapter(new EfficientAdapter(getBaseContext()));&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;  
&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--
google_ad_client = &quot;ca-pub-0203000218086978&quot;;
/* Mid-Post */
google_ad_slot = &quot;0253944060&quot;;
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;
src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;
&lt;/script&gt;
&lt;br /&gt;  
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;References (&amp;amp; many, many thanks to):&lt;br /&gt;
&lt;br /&gt;
Custom list row &amp;amp; adapter:&amp;nbsp;&lt;a href=&quot;http://www.androidpeople.com/android-custom-dynamic-listview/&quot;&gt;http://www.androidpeople.com/android-custom-dynamic-listview/&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Custom spinner row &amp;amp; adapter:&amp;nbsp;&lt;a href=&quot;http://android-er.blogspot.com/2010/12/custom-arrayadapter-for-spinner-with.html&quot;&gt;http://android-er.blogspot.com/2010/12/custom-arrayadapter-for-spinner-with.html&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Update with my version later...&lt;/span&gt;


&lt;/body&gt;
&lt;/html&gt;
</content><link rel='replies' type='application/atom+xml' href='http://androidgeisha.blogspot.com/feeds/1399989570662301515/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidgeisha.blogspot.com/2011/01/seriously-this-is-how-i-made-list-item.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5834825895105257420/posts/default/1399989570662301515'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5834825895105257420/posts/default/1399989570662301515'/><link rel='alternate' type='text/html' href='http://androidgeisha.blogspot.com/2011/01/seriously-this-is-how-i-made-list-item.html' title='Seriously, this is how I made a multi-column list item populated by strings!!'/><author><name>HappyGeisha</name><uri>http://www.blogger.com/profile/00311271943841904211</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-5834825895105257420.post-2349761661223315228</id><published>2011-01-14T10:33:00.000-08:00</published><updated>2012-06-06T07:48:08.593-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Custom Design"/><title type='text'>Custom Button Using XML</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;1. Create a custombuttonlayout.xml file in the drawable folder&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Selector: this element surrounds the entire xml. It defines this drawable as a selecter (e.g. buttons, list rows, or anything that can be &quot;selected&quot;)&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Items: There are three buttons states that &lt;i&gt;must&lt;/i&gt; be defined:&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;pressed,&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;focused, normal. However, there are a total of seven states that can be defined(pressed, focused, selected, checkable, checked,&amp;nbsp;enabled, and window_focused).These are defined as three&amp;nbsp;separate&amp;nbsp;&quot;items&quot;. Due to the nature of the way java programs are read (basically from the top down) you need to define items in this specific order, with pressed first, focused next, and normal last to get the buttons to display correctly.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Gradient: Android buttons typically have a highlight/lowlight gradient, so you should define two colors, and the angle of the &quot;shadow&quot;.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Stroke: I think this defines the outline style of the button? Not too sure...&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Corners: creates a rounded button corner. The default android radius value is &quot;5dp&quot;.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Padding: This defines the blank space between the button text and the button borders.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;custombuttonlayout.xml&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;lt;selector&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;lt;item&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;android:state_pressed=&quot;true&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;shape&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;gradient&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:startColor=&quot;#FFFF40&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:endColor=&quot;#FFFFC0&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:angle=&quot;270&quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;stroke&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:width=&quot;1dp&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:color=&quot;#000000&quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;corners&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:radius=&quot;5dp&quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;padding&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:left=&quot;10dp&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:top=&quot;15dp&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:right=&quot;10dp&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:bottom=&quot;15dp&quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;/shape&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;lt;/item&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;lt;item&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;android:state_focused=&quot;true&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;shape&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;gradient&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:endColor=&quot;#8080FF&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:startColor=&quot;#C0C0C0&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:angle=&quot;270&quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;stroke&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:width=&quot;1dp&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:color=&quot;#4A494A&quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;corners&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:radius=&quot;5dp&quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;padding&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:left=&quot;10dp&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:top=&quot;15dp&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:right=&quot;10dp&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:bottom=&quot;15dp&quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;/shape&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;lt;/item&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;lt;item&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;shape&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;gradient&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:endColor=&quot;#8080FF&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:startColor=&quot;#C0C0C0&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:angle=&quot;270&quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;stroke&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:width=&quot;1dp&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:color=&quot;#000000&quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;corners&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:radius=&quot;5dp&quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;padding&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:left=&quot;10dp&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:top=&quot;15dp&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:right=&quot;10dp&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:bottom=&quot;15dp&quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;/shape&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;lt;/item&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;lt;/selector&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;2. In the main.xml layout when you insert a button that you want to apply the layout to:&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Define the button background source as the drawable/custombuttonlayout.xml from above.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;excerpt&amp;nbsp;from main.xml:&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;lt;Button&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:layout_width=&quot;wrap_content&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:text=&quot;Sample Text&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:id=&quot;@+id/Button01&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:layout_height=&quot;wrap_content&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;android:background=&quot;@drawable/custombuttonlayout&quot;&amp;gt;&amp;lt;/Button&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Resources:&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;1)&amp;nbsp;&lt;a href=&quot;http://developer.android.com/guide/topics/resources/drawable-resource.html#StateList&quot;&gt;http://developer.android.com/guide/topics/resources/drawable-resource.html#StateList&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;2)&amp;nbsp;&lt;a href=&quot;http://developer.android.com/guide/topics/resources/color-list-resource.html&quot;&gt;http://developer.android.com/guide/topics/resources/color-list-resource.html&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;3)&amp;nbsp;&lt;a href=&quot;http://developer.android.com/reference/android/widget/Button.html&quot;&gt;http://developer.android.com/reference/android/widget/Button.html&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;4)&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://androiddrawableexplorer.appspot.com/&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;http://androiddrawableexplorer.appspot.com/&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;5)&amp;nbsp;&lt;a href=&quot;http://developer.android.com/guide/topics/resources/drawable-resource.html#Shape&quot;&gt;http://developer.android.com/guide/topics/resources/drawable-resource.html#Shape&lt;/a&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidgeisha.blogspot.com/feeds/2349761661223315228/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidgeisha.blogspot.com/2011/01/custom-button-using-xml.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5834825895105257420/posts/default/2349761661223315228'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5834825895105257420/posts/default/2349761661223315228'/><link rel='alternate' type='text/html' href='http://androidgeisha.blogspot.com/2011/01/custom-button-using-xml.html' title='Custom Button Using XML'/><author><name>HappyGeisha</name><uri>http://www.blogger.com/profile/00311271943841904211</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-5834825895105257420.post-2985802945932531162</id><published>2010-12-13T09:20:00.000-08:00</published><updated>2010-12-14T13:28:00.033-08:00</updated><title type='text'>Date Picker Frustrations</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;The date picker for the scheduler part of my app has somehow completely disappeared from&amp;nbsp;existence. Did I dream that this was a working widget and never bothered to try it out in real life!? Anyhow, I&#39;m trying to implement a date picker from an options menu click event inside a tabhost and the code is giving me a load of problems. Damn you,&amp;nbsp;ambiguously&amp;nbsp;written &lt;a href=&quot;http://developer.android.com/resources/tutorials/views/hello-datepicker.html&quot;&gt;android dev tutorial&lt;/a&gt;!&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;The result -- I think trying to implement a date picker in tabhost is impossible. Something about the content view... had to work around the problem by adding a &quot;select a date&quot; button into the activity controlling that particular tab and removing the troublesome item from the options menu.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidgeisha.blogspot.com/feeds/2985802945932531162/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidgeisha.blogspot.com/2010/12/date-picker-frustrations.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5834825895105257420/posts/default/2985802945932531162'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5834825895105257420/posts/default/2985802945932531162'/><link rel='alternate' type='text/html' href='http://androidgeisha.blogspot.com/2010/12/date-picker-frustrations.html' title='Date Picker Frustrations'/><author><name>HappyGeisha</name><uri>http://www.blogger.com/profile/00311271943841904211</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-5834825895105257420.post-7534591194177961560</id><published>2010-12-03T13:50:00.000-08:00</published><updated>2010-12-03T13:50:17.682-08:00</updated><title type='text'>Saving State on Orientation Change</title><content type='html'>&lt;div class=&quot;MsoNormal&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;u&gt;&lt;span style=&quot;mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;&quot;&gt;Problem:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;&quot;&gt;Form loses state on orientation change. This is due to onCreate being called on orientation change. This affects pages with forms half-filled out becoming blank.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;u&gt;&lt;span style=&quot;mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;&quot;&gt;Solution:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;&quot;&gt;In Manifest.xml, go to Application tab, select the Activity in question (yes, you have to do this for EVERY activity you want to protect). For Config Changes select “keyboardHidden” and “orientation”. Worked for me.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidgeisha.blogspot.com/feeds/7534591194177961560/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidgeisha.blogspot.com/2010/12/saving-state-on-orientation-change.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5834825895105257420/posts/default/7534591194177961560'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5834825895105257420/posts/default/7534591194177961560'/><link rel='alternate' type='text/html' href='http://androidgeisha.blogspot.com/2010/12/saving-state-on-orientation-change.html' title='Saving State on Orientation Change'/><author><name>HappyGeisha</name><uri>http://www.blogger.com/profile/00311271943841904211</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-5834825895105257420.post-1867027476712643748</id><published>2010-12-03T13:46:00.000-08:00</published><updated>2012-06-06T07:46:22.223-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="List View"/><title type='text'>Repainting a ListView Adapter from a Separate Activity</title><content type='html'>Basically, I have a page with a search box. You search for something, get the results in the form of a list on a pop-up dialog (which has its own activity). When you select one of the results, the dialog closes, and the item is added to the original page with the search box. You can repeat this, ad nauseum. *NOTE* This method requires an API level of at least 1.6.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;PageOne.java&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
Be sure to declare variables for the strings and adapter before onCreate. Static makes it available to use by other activities in the package:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;white-space: pre;&quot;&gt; static List&amp;lt;String&amp;gt; strings;  ListView lv;  static ListAdapter adapter;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Define these variables inside onCreate:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;strings = new ArrayList&amp;lt;String&amp;gt;(); &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;lv = getListView();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;adapter = new ArrayAdapter&amp;lt;String&amp;gt;(this, R.layout.list_item, R.id.label, strings);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;lv.setAdapter(adapter);&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;PageTwo.java&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
In the onClick method, add code to transform selected item to a string value. Then, adds the item to the String Array in PageOne. Last, notifyDataSetChanged on the adapter used in pageone:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;@Override &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;public void onListItemClick(ListView parent, View v, int position, long id) {  &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;selected = ((TextView) v).getText().toString();  &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;PageOne.strings.add(selected);  &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;((ArrayAdapter&amp;lt;String&amp;gt;) PageOne.adapter).notifyDataSetChanged(); &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt; this.finish();    &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidgeisha.blogspot.com/feeds/1867027476712643748/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidgeisha.blogspot.com/2010/12/repainting-listview-adapter-from.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5834825895105257420/posts/default/1867027476712643748'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5834825895105257420/posts/default/1867027476712643748'/><link rel='alternate' type='text/html' href='http://androidgeisha.blogspot.com/2010/12/repainting-listview-adapter-from.html' title='Repainting a ListView Adapter from a Separate Activity'/><author><name>HappyGeisha</name><uri>http://www.blogger.com/profile/00311271943841904211</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-5834825895105257420.post-6188246676475615938</id><published>2010-12-02T10:37:00.000-08:00</published><updated>2012-06-06T07:50:48.249-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Fixing Errors"/><title type='text'>&quot;Conversion to Dalvik format failed with error 1&quot;</title><content type='html'>Ugh. Don&#39;t you hate errors that aren&#39;t in the code, and don&#39;t go away no matter how many times you fix project setup or clean.&lt;br /&gt;
&lt;br /&gt;
Heres what I got in the console:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;[2010-12-02 10:38:10 - MDatHand]&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;trouble processing &quot;java/lang/Object.class&quot;:&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;[2010-12-02 10:38:10 - MDatHand]&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;Attempt to include a core VM class in something other than a core library.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;It is likely that you have attempted to include the core library from a desktop&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;virtual machine into an application, which will most assuredly not work. If&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;you really intend to build a core library -- which is only appropriate as&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;part of creating a full virtual machine binary, as opposed to compiling an&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;application -- then use the &quot;--core-library&quot; option to suppress this error&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;message. If you go ahead and use &quot;--core-library&quot; but are in fact building&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;an application, then please be aware that your build will still fail at some&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;point; you will simply be denied the pleasure of reading this helpful error&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;message.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;[2010-12-02 10:38:10 - MDatHand] 1 error; aborting&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;[2010-12-02 10:38:10 - MDatHand] Conversion to Dalvik format failed with error 1&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Oh yeah... this was certainly a real pleasure... jerk. The only thing I understand in all that garbage is &quot;library&quot; not that that give me any damn clue on how to fix it. How but just a nice error message that says &quot;FIX YOUR LIBRARY SETTINGS&quot;????? Anywho, I digress...&lt;br /&gt;
&lt;br /&gt;
I did some soul searching on the interwebs, and a nice man by the name of Jim had posted a reasonable solution. I&#39;m posting it herein the event the error pops up again again:&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, Georgia, serif; font-size: 14px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;I received the following message and found several others who had seen&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, Georgia, serif; font-size: 14px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, Georgia, serif; font-size: 14px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;it but no solution. So I have included how I finally fixed it. (I&#39;m&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, Georgia, serif; font-size: 14px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, Georgia, serif; font-size: 14px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;using Eclipse version 3.4.2 and Android 1.5.)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, Georgia, serif; font-size: 14px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, Georgia, serif; font-size: 14px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, Georgia, serif; font-size: 14px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;...&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, Georgia, serif; font-size: 14px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, Georgia, serif; font-size: 14px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;The fix for me was to go to my project&#39;s properties, select:&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, Georgia, serif; font-size: 14px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, Georgia, serif; font-size: 14px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, Georgia, serif; font-size: 14px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;Java Build Path -&amp;gt; Libraries (tab)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, Georgia, serif; font-size: 14px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, Georgia, serif; font-size: 14px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, Georgia, serif; font-size: 14px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;Somehow, the android.jar had been added, and when I deleted it, all&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, Georgia, serif; font-size: 14px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, Georgia, serif; font-size: 14px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;was good. Note that the android.jar is included as part of the&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, Georgia, serif; font-size: 14px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, Georgia, serif; font-size: 14px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;Android 1.5 library, so this was a duplication.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, Georgia, serif; font-size: 14px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, Georgia, serif; font-size: 14px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, Georgia, serif; font-size: 14px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;How did this happen? I certainly didn&#39;t do it. But my app has blown&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, Georgia, serif; font-size: 14px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, Georgia, serif; font-size: 14px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;up a lot in the emulator, so who knows.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, Georgia, serif; font-size: 14px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, Georgia, serif; font-size: 14px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, Georgia, serif; font-size: 14px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;Later . . . Jim&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, Georgia, serif; font-size: 14px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #38761d;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, Georgia, serif; font-size: 14px;&quot;&gt;THANKS JIM :]&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidgeisha.blogspot.com/feeds/6188246676475615938/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidgeisha.blogspot.com/2010/12/conversion-to-dalvik-format-failed-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5834825895105257420/posts/default/6188246676475615938'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5834825895105257420/posts/default/6188246676475615938'/><link rel='alternate' type='text/html' href='http://androidgeisha.blogspot.com/2010/12/conversion-to-dalvik-format-failed-with.html' title='&quot;Conversion to Dalvik format failed with error 1&quot;'/><author><name>HappyGeisha</name><uri>http://www.blogger.com/profile/00311271943841904211</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-5834825895105257420.post-288150985450620237</id><published>2010-11-30T08:10:00.000-08:00</published><updated>2012-06-06T07:55:36.905-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="html"/><title type='text'>Marquee Attributes</title><content type='html'>This has absolutely nothing to do with Android or Java.&lt;br /&gt;
&lt;br /&gt;
I had a text marquee announcement news thingy on my company website, and I didn&#39;t want to lose the code because it took me a full day to figure out how to use marquee attributes.&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;&amp;lt;marquee behavior=&quot;scroll&quot; direction=&quot;left&quot; scollamount=&quot;1&quot; onmouseover=&quot;this.stop();&quot; onmouseout=&quot;this.start();&quot;&amp;gt;&amp;lt;/marquee&amp;gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidgeisha.blogspot.com/feeds/288150985450620237/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidgeisha.blogspot.com/2010/11/marquee-attributes.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5834825895105257420/posts/default/288150985450620237'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5834825895105257420/posts/default/288150985450620237'/><link rel='alternate' type='text/html' href='http://androidgeisha.blogspot.com/2010/11/marquee-attributes.html' title='Marquee Attributes'/><author><name>HappyGeisha</name><uri>http://www.blogger.com/profile/00311271943841904211</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-5834825895105257420.post-1715557914996424367</id><published>2010-11-26T21:47:00.000-08:00</published><updated>2012-06-06T07:55:27.432-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Eclipse"/><title type='text'>Setting up Android Development Environment with Eclipse</title><content type='html'>I&#39;ve done set up a fifth computer with the Android Dev environment and every time it&#39;s a gorram struggle. I hate setting up workstations! So here I am, finally conceding to the idea that there will never be a last and final time for the most tedious, time consuming, and confusing chores.&lt;br /&gt;
&lt;br /&gt;
1) &lt;b&gt;Download&amp;nbsp;&lt;/b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 20px;&quot;&gt;&lt;b&gt;Eclipse IDE for Java Developers&lt;/b&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;3.5 (Galileo).&amp;nbsp;&lt;/b&gt;The newer version 3.6 Helios is not supported by android. Galileo comes as a zip file, no install necessary. Unzip somewhere you will remember, and make shortcuts to your desktop/task bar/whatever.&lt;br /&gt;
&lt;a href=&quot;http://www.eclipse.org/downloads/packages/eclipse-ide-java-developers/galileor&quot;&gt;http://www.eclipse.org/downloads/packages/eclipse-ide-java-developers/galileor&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
2) &lt;b&gt;Download JDK/JRE v.6 (or the new v.7)&lt;/b&gt;. Follow the install. You will need a login username and password for Sun Microsystems. (*Optional: After install, find the jdk folder, and copy the &quot;jre&quot; file into your eclipse folder. I don&#39;t know if this is the correct way to do this, but it works for me. Particularly useful if you downloaded the Android SDK as a zip rather than the installer.)&lt;br /&gt;
&lt;a href=&quot;http://www.oracle.com/technetwork/java/javase/downloads/index.html&quot;&gt;http://www.oracle.com/technetwork/java/javase/downloads/index.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
3) &lt;b&gt;Download Android SDK&lt;/b&gt;. This can also come as a zip file but also includes an installer which I will recommend, because the installer will &quot;link&quot; the Android SDK to the JDK. Whatever that means. But because of this linking thing, the JDK has to be fully installed first in order to run.&lt;br /&gt;
&lt;a href=&quot;http://developer.android.com/sdk/index.html&quot;&gt;http://developer.android.com/sdk/index.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
4)&amp;nbsp;&lt;b&gt;Add SDK Platform.&lt;/b&gt;&amp;nbsp;After the installer from step 3 finishes, start the SDK program. Start checking off stuff to add. You need at least ONE platform to begin developing in android. You will need to download all the versions you plan on testing on. Be sure to add packages in small groups, if you try to do it all at once it crashes or never finishes.&lt;br /&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;a href=&quot;http://developer.android.com/sdk/adding-components.html&quot;&gt;http://developer.android.com/sdk/adding-components.html&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
5)&amp;nbsp;&lt;b&gt;&quot;Download&quot;/Install/Configure ADT plugin&lt;/b&gt;. Finish downloading the SDK in step 4 before attempting this. Adding the ADT to Eclipse requires use of the &quot;Adding new software&quot; option from the Help menu.&amp;nbsp;Its awful and feels wrong. Instructions at the link below. Be sure to follow the steps for downloading AND configuring the ADT plugin!&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;a href=&quot;http://developer.android.com/sdk/eclipse-adt.html#downloading&quot;&gt;http://developer.android.com/sdk/eclipse-adt.html#downloading&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
6) &lt;b&gt;Create an AVD&lt;/b&gt; (Android Virtual Device.) &amp;nbsp;This is the emulator. I set the target to Android 2.2 - API Level 8, and the skin to WVGA854&lt;br /&gt;
&lt;a href=&quot;http://developer.android.com/guide/developing/tools/avd.html#creating&quot;&gt;http://developer.android.com/guide/developing/tools/avd.html#creating&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Resources:&lt;br /&gt;
&lt;a href=&quot;http://developer.android.com/sdk/requirements.html&quot;&gt;http://developer.android.com/sdk/requirements.html&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://developer.android.com/sdk/installing.html&quot;&gt;http://developer.android.com/sdk/installing.html&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidgeisha.blogspot.com/feeds/1715557914996424367/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidgeisha.blogspot.com/2010/11/setting-up-android-dev-environment-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5834825895105257420/posts/default/1715557914996424367'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5834825895105257420/posts/default/1715557914996424367'/><link rel='alternate' type='text/html' href='http://androidgeisha.blogspot.com/2010/11/setting-up-android-dev-environment-with.html' title='Setting up Android Development Environment with Eclipse'/><author><name>HappyGeisha</name><uri>http://www.blogger.com/profile/00311271943841904211</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-5834825895105257420.post-1140837059398974611</id><published>2010-11-18T13:07:00.000-08:00</published><updated>2010-11-18T13:08:40.058-08:00</updated><title type='text'>Adding xml Layout to an Existing xml Layout Dynamically</title><content type='html'>So some background information is needed for this tutorial. My project requires many many many screens. It&#39;s incredibly difficult to keep track of all these for development purposes, and on top of that it makes load time on the phone mind-bogglingly slow. So I am trying to create generic &quot;blank&quot; screens to use and reuse for my applications. In this particular example, I have created a generic list screen with a TextView &quot;title&quot; and a blank ListView. I already know that I can programically change the row styling, data entries, the text in the title, etc etc. But I needed to add a row of buttons to the bottom. So I created a simple xml layout with some buttons inside a horizontal linear layout. This is where I hit the snag. I assumed it would be simple to just say &lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;mainlayout.addView(extrabuttonslayout);&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #cccccc;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
I was wrong.&lt;br /&gt;
&lt;br /&gt;
So after three or four days of searching, attempting, failing... (Yeah I know I&#39;m slow) I magically discovered four magical lines of text that allow me to make all my wildest dreams come true. At least for now.&lt;br /&gt;
&lt;br /&gt;
So here&#39;s how I did it:&lt;br /&gt;
&lt;br /&gt;
main.xml&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;&lt;div&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;android:orientation=&quot;vertical&quot; android:layout_height=&quot;fill_parent&quot;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;android:layout_width=&quot;fill_parent&quot; android:id=&quot;@+id/LinearLayout_listview&quot;&amp;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;lt;TextView android:layout_height=&quot;wrap_content&quot;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;android:layout_width=&quot;fill_parent&quot; android:text=&quot;title&quot; android:id=&quot;@+id/TextView_Title&quot;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;android:padding=&quot;5px&quot; android:textSize=&quot;20px&quot; /&amp;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;lt;ListView android:layout_height=&quot;wrap_content&quot; android:id=&quot;@android:id/list&quot;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;android:layout_width=&quot;fill_parent&quot; android:layout_weight=&quot;1&quot; /&amp;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;lt;FrameLayout android:layout_height=&quot;wrap_content&quot;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;android:id=&quot;@+id/FrameLayout_listview&quot; android:layout_width=&quot;fill_parent&quot; /&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;lt;/LinearLayout&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;/span&gt;&lt;br /&gt;
extrabuttonlayout.xml&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;&amp;lt;LinearLayout android:layout_height=&quot;wrap_content&quot; android:layout_width=&quot;fill_parent&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;android:gravity=&quot;center&quot; android:id=&quot;@+id/LinearLayout_er&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;&amp;lt;Button android:layout_width=&quot;wrap_content&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;   &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;android:layout_height=&quot;wrap_content&quot; android:text=&quot;Search&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;   &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;android:minWidth=&quot;100px&quot; android:id=&quot;@+id/btnEmergencyResponse_Search&quot;&amp;gt;&amp;lt;/Button&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;&amp;lt;Button android:layout_width=&quot;wrap_content&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;   &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;android:layout_height=&quot;wrap_content&quot; android:text=&quot;Exit&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;   &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;android:minWidth=&quot;100px&quot; android:id=&quot;@+id/btnEmergencyResponse_Exit&quot;&amp;gt;&amp;lt;/Button&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;&amp;lt;/LinearLayout&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
and finally the oh so dynamic MainActivity.java (I only included the part where I dynamically add a view, for info on how to dynamically populate a listview, or handle click evens, see my other entries.) Basically here we are setting our layout to be a &quot;view&quot; and then adding the view to the main layout. Silly me, I already thought it was a view...&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;public class MainActivity extends ListActivity {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;LayoutInflater linflater;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;LinearLayout llList;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;LinearLayout llER;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;/** Called when the activity is first created. */&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;@Override&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;public void onCreate(Bundle savedInstanceState) {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;super.onCreate(savedInstanceState);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;setContentView(R.layout.main);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;//trying to add view to listview.xml&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;llList = (LinearLayout) findViewById(R.id.LinearLayout_listview);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;linflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;View myView = linflater.inflate(R.layout.extrabuttonlayout, null);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;llList.addView(myView);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;}&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidgeisha.blogspot.com/feeds/1140837059398974611/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidgeisha.blogspot.com/2010/11/adding-xml-layout-to-existing-xml.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5834825895105257420/posts/default/1140837059398974611'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5834825895105257420/posts/default/1140837059398974611'/><link rel='alternate' type='text/html' href='http://androidgeisha.blogspot.com/2010/11/adding-xml-layout-to-existing-xml.html' title='Adding xml Layout to an Existing xml Layout Dynamically'/><author><name>HappyGeisha</name><uri>http://www.blogger.com/profile/00311271943841904211</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-5834825895105257420.post-6927831270036063573</id><published>2010-10-13T10:50:00.000-07:00</published><updated>2010-10-13T10:51:55.352-07:00</updated><title type='text'>Using Intent and Bundle to pass String values to a new Activity.</title><content type='html'>So it took me three days to figure out how to pass on a string value from an old activity to a new one. This version uses bundle and intent.&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;I have only used this when starting a new activity with a button , list item , and menu item clicks events, although I&#39;m sure it can be applied to many more types.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;You will need two activities. My example uses a list item click to set up a regular intent. A bundle is created with a string value, and its variables are &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;(&quot;unique.key.name&quot;, &quot;The string you want to pass on&quot;)&lt;/span&gt;. &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;(items[position])&lt;/span&gt; is code that displays the text value of the list item that was selected. Then the bundle is added to the intent.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;b&gt;Page1.java&lt;/b&gt;&lt;br /&gt;
&lt;blockquote&gt;&lt;blockquote&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;public void onListItemClick(ListView parent, View view, int position, long id) {&lt;/span&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;Intent i = new Intent(Page1.this, Page2.class);&lt;/span&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;Bundle extras = new Bundle();&lt;/span&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;extras.putString(&quot;my.unique.extras.key&quot;, (items[position]) + &quot; Details&quot;);&lt;/span&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;i.putExtras(extras); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;startActivity(i);&lt;/span&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;br /&gt;
Page2 activity needs to have a textview item ready to receive the bundle (this would look like &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;uniquetextview.setText(extras.getString(&quot;(&quot;my.unique.extras.key&quot;))&lt;/span&gt;. An alternative is to set the bundle to be the activities title, as in my example below.&lt;br /&gt;
&lt;br /&gt;
Page2.java&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;&amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;// Adds selected listview item to title&lt;/span&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Bundle extras = this.getIntent().getExtras();&lt;/span&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;if ( extras != null ) {&lt;/span&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt; &amp;nbsp;if ( extras.containsKey(&quot;my.unique.extras.key&quot;) ) {&lt;/span&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;   &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt; &amp;nbsp;this.setTitle(extras.getString(&quot;my.unique.extras.key&quot;));&lt;/span&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt; &amp;nbsp;}&lt;/span&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;}&lt;/span&gt;&lt;/blockquote&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidgeisha.blogspot.com/feeds/6927831270036063573/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidgeisha.blogspot.com/2010/10/using-intent-and-bundle-to-pass-string.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5834825895105257420/posts/default/6927831270036063573'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5834825895105257420/posts/default/6927831270036063573'/><link rel='alternate' type='text/html' href='http://androidgeisha.blogspot.com/2010/10/using-intent-and-bundle-to-pass-string.html' title='Using Intent and Bundle to pass String values to a new Activity.'/><author><name>HappyGeisha</name><uri>http://www.blogger.com/profile/00311271943841904211</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-5834825895105257420.post-5238561974989488867</id><published>2010-10-07T09:08:00.000-07:00</published><updated>2012-06-06T07:48:08.602-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Custom Design"/><category scheme="http://www.blogger.com/atom/ns#" term="List View"/><title type='text'>Easy ListView with Anchored Header/Footer and &quot;Custom&quot; Row Layout.</title><content type='html'>This is the basic listview that has been working great for me.&lt;br /&gt;
&lt;br /&gt;
Disclaimer: While the list item view for this is &quot;custom&quot; it &lt;u&gt;does not&lt;/u&gt; allow you to provide more than one view per list item. You can customize that one item (background, font, size, color, etc.) To add more views to a list item please see my entry on &lt;a href=&quot;http://androidgeisha.blogspot.com/2011/01/seriously-this-is-how-i-made-list-item.html&quot;&gt;custom list adapters&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
First is the page layout. I only included a simple textview header, but it could easily be replaced with buttons or checkboxes or anything. The surrounding linear layout but be set to &quot;fill_parent&quot; height and width and also have a vertical orientation. The listview width should be set to &quot;fill_parent&quot; so that the whole list row is clickable and not just the text. layout_weight should be set to 1 which will cause the listview to expand to the height of available space in the window, pushing the header or footer to be docked at the top or bottom.&lt;br /&gt;
&lt;br /&gt;
&lt;center&gt;
&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--
google_ad_client = &quot;ca-pub-0203000218086978&quot;;
/* Mid-Post */
google_ad_slot = &quot;0253944060&quot;;
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;
src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;
&lt;/script&gt;
&lt;/center&gt;
&lt;br /&gt;
&lt;br /&gt;

&lt;b&gt;pageone.xml&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999; font-family: Arial; font-size: small;&quot;&gt;
xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;android:layout_height=&quot;fill_parent&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;android:layout_width=&quot;fill_parent&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;android:orientation=&quot;vertical&quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;TextView android:layout_height=&quot;wrap_content&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;android:layout_width=&quot;fill_parent&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;android:text=&quot;This is the Header&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;android:id=&quot;@+id/Header&quot; &amp;gt;&lt;br /&gt;
&amp;lt;/TextView&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ListView &lt;br /&gt;
&amp;nbsp;&amp;nbsp;android:layout_width=&quot;fill_parent&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;android:layout_height=&quot;wrap_content&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;android:layout_weight=&quot;1&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;android:textFilterEnabled=&quot;true&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;android:id=&quot;@android:id/list&quot; &amp;gt;&lt;br /&gt;
&amp;lt;/ListView&amp;gt;&lt;br /&gt;
&amp;lt;/LinearLayout&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
The row layout is important if you want to customize the look of your list (like text size, color, etc). Otherwise, android has some built in layouts that can be used. In my example, I am just using a single textview (easily populated by string values using simpleadapter) with a small font. Add more textviews in a horizontal linear layout for columns, or vertical for two rows of text. Use relative layout to add photos and for even more customization. Remember the id of the textviews that will be populated by simple adapter later on. (EDIT: If you want to use additional text views, image views check boxes or whatever, you need to use a &lt;a href=&quot;http://androidgeisha.blogspot.com/2011/01/seriously-this-is-how-i-made-list-item.html&quot;&gt;custom adapter&lt;/a&gt;!)&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;list_item.xml&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999; font-family: Arial; font-size: small;&quot;&gt;
&amp;lt;TextView xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;android:layout_width=&quot;fill_parent&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;android:layout_height=&quot;fill_parent&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;android:padding=&quot;10dp&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;android:textSize=&quot;16sp&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;android:id=&quot;@+id/label&quot;&amp;gt;&lt;br /&gt;
&amp;lt;/TextView&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
In the java file, include a String of the items you want to display before the onCreate. Set the list Adapter in onCreate. Set up list item click event handler after onCreate. Right now, it is set up to display a toast message of the list item selected.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;PageOne.java&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999; font-family: Arial; font-size: small;&quot;&gt;
public class StepTherapy extends ListActivity {&lt;br /&gt;
&lt;br /&gt;
String[] items={&quot;lorem&quot;, &quot;ipsum&quot;, &quot;dolor&quot;, &quot;sit&quot;, &quot;amet&quot;,&lt;br /&gt;
&quot;consectetuer&quot;, &quot;adipiscing&quot;, &quot;elit&quot;, &quot;morbi&quot;, &quot;vel&quot;,&lt;br /&gt;
&quot;ligula&quot;, &quot;vitae&quot;, &quot;arcu&quot;, &quot;aliquet&quot;, &quot;mollis&quot;,&lt;br /&gt;
&quot;etiam&quot;, &quot;vel&quot;, &quot;erat&quot;, &quot;placerat&quot;, &quot;ante&quot;,&lt;br /&gt;
&quot;porttitor&quot;, &quot;sodales&quot;, &quot;pellentesque&quot;, &quot;augue&quot;,&lt;br /&gt;
&quot;purus&quot;};
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;/** Called when the activity is first created. */&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;@Override&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;public void onCreate(Bundle savedInstanceState) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;super.onCreate(savedInstanceState);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;setContentView(R.layout.steptherapy);&lt;br /&gt;
&lt;br /&gt;
ListView lv = (ListView)getListView();&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;lv.setAdapter(new ArrayAdapter&amp;lt;String&amp;gt;(this, R.layout.list_item, R.id.label, items));&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;public void onListItemClick(ListView parent, View v, int position, long id) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Toast.makeText(getApplicationContext(), ((TextView) v).getText(), Toast.LENGTH_SHORT).show();&lt;br /&gt;
}&lt;br /&gt;
}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;center&gt;
&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--
google_ad_client = &quot;ca-pub-0203000218086978&quot;;
/* Mid-Post */
google_ad_slot = &quot;0253944060&quot;;
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;
src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;
&lt;/script&gt;
&lt;/center&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidgeisha.blogspot.com/feeds/5238561974989488867/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidgeisha.blogspot.com/2010/10/easy-listview-with-headerfooter-and.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5834825895105257420/posts/default/5238561974989488867'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5834825895105257420/posts/default/5238561974989488867'/><link rel='alternate' type='text/html' href='http://androidgeisha.blogspot.com/2010/10/easy-listview-with-headerfooter-and.html' title='Easy ListView with Anchored Header/Footer and &quot;Custom&quot; Row Layout.'/><author><name>HappyGeisha</name><uri>http://www.blogger.com/profile/00311271943841904211</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>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5834825895105257420.post-8821737161404825527</id><published>2010-10-04T13:59:00.001-07:00</published><updated>2012-06-06T07:44:44.006-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Tabbed Layout"/><title type='text'>Easy Tab Layout using separate Activities to fill Tab Content.</title><content type='html'>&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;font-size: small;&quot;&gt;This is the working tab layout that I have designed thus far. This project requires three xml layouts, two xml drawables and a three java classes (and two png drawables for tab logos).&lt;/span&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;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&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;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;The main.xml file should have the following. Elements like buttons or TextViews that are needed to be displayed outside of the tabs or tab window should be placed above or below TabHost. Use the include method to add tab content layout files.&lt;/span&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;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; &lt;/span&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;font-size: small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b&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;font-size: small;&quot;&gt;main.xml&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;blockquote&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&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;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;lt;TabHost&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&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;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&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;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&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;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&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;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;nbsp;&amp;nbsp;android:id=&quot;@android:id/tabhost&quot;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&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;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&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;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&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;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;nbsp;&amp;nbsp;android:layout_width=&quot;fill_parent&quot;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&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;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&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;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&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;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;nbsp;&amp;nbsp;android:layout_height=&quot;fill_parent&quot;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&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;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&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;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&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;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;nbsp;&amp;nbsp;android:isScrollContainer=&quot;true&quot;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;b&gt;&lt;b&gt;&lt;b&gt;&lt;/b&gt;&lt;/b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;b&gt;&lt;b&gt;&lt;div style=&quot;display: inline !important;&quot;&gt;&lt;div style=&quot;display: inline !important;&quot;&gt;&lt;div style=&quot;display: inline !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;display: inline !important;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&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;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;lt;LinearLayout android:orientation=&quot;vertical&quot;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/b&gt;&lt;/b&gt;&lt;/b&gt;&lt;b&gt;&lt;b&gt;&lt;b&gt;&lt;b&gt;&lt;div style=&quot;display: inline !important;&quot;&gt;&lt;div style=&quot;display: inline !important;&quot;&gt;&lt;div style=&quot;display: inline !important;&quot;&gt;&lt;div style=&quot;display: inline !important;&quot;&gt;&lt;div style=&quot;display: inline !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;display: inline !important;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&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;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;android:layout_width=&quot;fill_parent&quot;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/b&gt;&lt;/b&gt;&lt;/b&gt;&lt;/b&gt;&lt;b&gt;&lt;b&gt;&lt;b&gt;&lt;b&gt;&lt;div style=&quot;display: inline !important;&quot;&gt;&lt;div style=&quot;display: inline !important;&quot;&gt;&lt;div style=&quot;display: inline !important;&quot;&gt;&lt;div style=&quot;display: inline !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;display: inline !important;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&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;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; android:layout_height=&quot;fill_parent&quot;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/b&gt;&lt;/b&gt;&lt;/b&gt;&lt;/b&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;b&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: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;div style=&quot;display: inline !important;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&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;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;lt;TabWidget android:id=&quot;@android:id/tabs&quot;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/b&gt;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;b&gt;&lt;b&gt;&lt;b&gt;&lt;div style=&quot;display: inline !important;&quot;&gt;&lt;div style=&quot;display: inline !important;&quot;&gt;&lt;div style=&quot;display: inline !important;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&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;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;nbsp;&amp;nbsp;android:layout_width=&quot;fill_parent&quot;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/b&gt;&lt;/b&gt;&lt;/b&gt;&lt;/b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;b&gt;&lt;b&gt;&lt;b&gt;&lt;div style=&quot;display: inline !important;&quot;&gt;&lt;div style=&quot;display: inline !important;&quot;&gt;&lt;div style=&quot;display: inline !important;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&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;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;nbsp;&amp;nbsp;android:layout_height=&quot;wrap_content&quot;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;b&gt;&lt;b&gt;&lt;b&gt;&lt;b&gt;&lt;b&gt;&lt;/b&gt;&lt;/b&gt;&lt;/b&gt;&lt;/b&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;b&gt;&lt;b&gt;&lt;b&gt;&lt;b&gt;&lt;div style=&quot;display: inline !important;&quot;&gt;&lt;div style=&quot;display: inline !important;&quot;&gt;&lt;div style=&quot;display: inline !important;&quot;&gt;&lt;b&gt;&lt;b&gt;&lt;b&gt;&lt;b&gt;&lt;b&gt;&lt;div style=&quot;display: inline !important;&quot;&gt;&lt;div style=&quot;display: inline !important;&quot;&gt;&lt;div style=&quot;display: inline !important;&quot;&gt;&lt;div style=&quot;display: inline !important;&quot;&gt;&lt;div style=&quot;display: inline !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;display: inline !important;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&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;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;lt;/TabWidget&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/b&gt;&lt;/b&gt;&lt;/b&gt;&lt;/b&gt;&lt;/b&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/b&gt;&lt;/b&gt;&lt;/b&gt;&lt;/b&gt;&lt;/b&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/b&gt;&lt;/b&gt;&lt;/b&gt;&lt;/b&gt;&lt;/b&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;b&gt;&lt;b&gt;&lt;b&gt;&lt;b&gt;&lt;b&gt;&lt;div style=&quot;display: inline !important;&quot;&gt;&lt;div style=&quot;display: inline !important;&quot;&gt;&lt;div style=&quot;display: inline !important;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&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;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;lt;FrameLayout android:id=&quot;@android:id/tabcontent&quot;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/b&gt;&lt;/b&gt;&lt;/b&gt;&lt;/b&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: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&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;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&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;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;nbsp;&amp;nbsp;android:layout_width=&quot;fill_parent&quot;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&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;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&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;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;nbsp;&amp;nbsp;android:layout_height=&quot;fill_parent&quot;&amp;gt;&amp;lt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: &#39;Times New Roman&#39;;&quot;&gt;&lt;b&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;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; font-weight: normal;&quot;&gt;&lt;b&gt;&lt;b&gt;&lt;b&gt;&lt;div style=&quot;display: inline !important;&quot;&gt;&lt;div style=&quot;display: inline !important;&quot;&gt;&lt;div style=&quot;display: inline !important;&quot;&gt;&lt;div style=&quot;display: inline !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;display: inline !important;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&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;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;/FrameLayout&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/b&gt;&lt;/b&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&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;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;lt;/LinearLayout&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&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;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal; white-space: pre;&quot;&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;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&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;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;lt;/TabHost&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/blockquote&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&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;font-size: small;&quot;&gt;I&#39;m only going to include two tabs. You need to have a separate layout.xml file for each tab&#39;s content.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&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;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&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;font-size: small;&quot;&gt;tab1.xml and tab2.xml (they are the same for the sake of this tutorial)&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;div style=&quot;display: inline !important;&quot;&gt;&lt;blockquote&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;div style=&quot;display: inline !important;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;lt;LinearLayout&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;/b&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;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;nbsp;&amp;nbsp;xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&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;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&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;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;nbsp;&amp;nbsp;android:id=&quot;@+id/scheduler_dayview&quot;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&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;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&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;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;nbsp;&amp;nbsp;android:layout_height=&quot;fill_parent&quot;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&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;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&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;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;nbsp;&amp;nbsp;android:layout_width=&quot;fill_parent&quot;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&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;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&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;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;nbsp;&amp;nbsp;android:orientation=&quot;vertical&quot;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&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;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&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;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&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;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;lt;TextView android:layout_width=&quot;fill_parent&quot;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&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;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;div style=&quot;display: inline !important;&quot;&gt;&lt;div style=&quot;display: inline !important;&quot;&gt;&lt;div style=&quot;display: inline !important;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;nbsp;&amp;nbsp;android:text=&quot;Tab 1&quot;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&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;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;nbsp;&amp;nbsp;android:padding=&quot;5px&quot;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&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;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&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;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;nbsp;&amp;nbsp;android:id=&quot;@+id/TextView01&quot;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&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;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&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;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;nbsp;&amp;nbsp;android:layout_height=&quot;wrap_content&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&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;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;div style=&quot;display: inline !important;&quot;&gt;&lt;div style=&quot;display: inline !important;&quot;&gt;&lt;div style=&quot;display: inline !important;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;lt;/TextView&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&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;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&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;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;lt;/LinearLayout&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&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;font-size: small;&quot;&gt;Again, for the sake of this tutorial, the tabs respective activities are the same.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&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;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&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;font-size: small;&quot;&gt;Tab1.java and Tab2.java&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&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;font-size: small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&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;font-size: small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&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;font-size: small;&quot;&gt;&lt;div&gt;&lt;blockquote&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&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;font-size: small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&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;font-size: small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&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;font-size: small;&quot;&gt;&lt;div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;public class Tab1 extends Activity {&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;   &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;/** Called when the activity is first created. */&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;   &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;@Override&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;   &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;public void onCreate(Bundle savedInstanceState) {&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;     &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;super.onCreate(savedInstanceState);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;     &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;setContentView(R.layout.tab1);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&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;font-size: small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&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;font-size: small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&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;font-size: small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&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;font-size: small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&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;font-size: small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&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;font-size: small;&quot;&gt;&lt;div style=&quot;display: inline !important;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&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;font-size: small;&quot;&gt;Now for the java class.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; &lt;/span&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;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; &lt;/span&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;font-size: small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;b&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;font-size: small;&quot;&gt;TabLayoutExample.Java&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div&gt;&lt;blockquote&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;public class&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;TabLayoutExample&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&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: #999999;&quot;&gt;extends TabActivity {&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&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: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&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: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;// Called when the activity is first created.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&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: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;@Override&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&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: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;public void onCreate(Bundle savedInstanceState) {&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&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: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;super.onCreate(savedInstanceState);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&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: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;setContentView(R.layout.main);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&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: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&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: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Tab Stuff&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&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: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;Resources res = getResources();&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;TabHost tabHost = getTabHost(); &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Intent intent; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Create an Intent to launch an Activity for the tab&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;intent = new Intent().setClass(this, Tab1.class);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Initialize a TabSpec for each tab and add it to the TabHost&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;tabHost.addTab(tabHost.newTabSpec(&quot;t1&quot;).setIndicator(&quot;Tab1&quot;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&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;res.getDrawable(R.drawable.tab1))&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&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;.setContent(intent));&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Do the same for the other tabs&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;intent = new Intent().setClass(this, Tab2.class);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;tabHost.addTab(tabHost.newTabSpec(&quot;t2&quot;).setIndicator(&quot;Tab2&quot;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&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;res.getDrawable(R.drawable.tab2))&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&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;.setContent(intent));&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;tabHost.setCurrentTab(0);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&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: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&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: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #999999;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;  &lt;/span&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;font-size: small;&quot;&gt; &lt;/span&gt;&lt;/span&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;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://androidgeisha.blogspot.com/feeds/8821737161404825527/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://androidgeisha.blogspot.com/2010/10/how-to-use-tab-layout.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5834825895105257420/posts/default/8821737161404825527'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5834825895105257420/posts/default/8821737161404825527'/><link rel='alternate' type='text/html' href='http://androidgeisha.blogspot.com/2010/10/how-to-use-tab-layout.html' title='Easy Tab Layout using separate Activities to fill Tab Content.'/><author><name>HappyGeisha</name><uri>http://www.blogger.com/profile/00311271943841904211</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></feed>