Hii All,

i have successfully make two applications as :
1.halloworld
2.tabhost
 now what i want is to use png/jpeg images for my application.
I my tab host application, i have three tabs, named as tab1,tab2,tab3.
now what i want is as soon as user click tab1 an image should be
visible,when clicks on tab2 another image should be visible and on on
third so on...

   Actually basic thing i want to learn through this is how to play
with images,resolution etc.......
   Where to store images in Android application and  how to
process(bind) them.i want to continue through my tabs application.The
whole code of that one is as follows:
package com.example.tabHello;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;

public class tabHello extends Activity {

private int ADD_NEW_TAB = Menu.FIRST;

@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.main);
TabHost tabs = (TabHost) this.findViewById(R.id.my_tabhost);
tabs.setup();
TabSpec tspec1 = tabs.newTabSpec("First Tab");
tspec1.setIndicator("One");
tspec1.setContent(R.id.content);
tabs.addTab(tspec1);
TabSpec tspec2 = tabs.newTabSpec("Second Tab");
tspec2.setIndicator("Two");
tspec2.setContent(R.id.content);
tabs.addTab(tspec2);
TabSpec tspec3 = tabs.newTabSpec("Third Tab");
tspec3.setIndicator("Three");
tspec3.setContent(R.id.content);
tabs.addTab(tspec3);
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu);

menu.add(0, ADD_NEW_TAB, 0, "New Tabs");
return true;
}


@Override
public boolean onOptionsItemSelected(MenuItem item) {

TabHost tabs = (TabHost) this.findViewById(R.id.my_tabhost);
tabs.clearAllTabs();
tabs.setup();
TabSpec tspec1 = tabs.newTabSpec("New Tab");
tspec1.setIndicator("NEWTAB",
this.getResources().getDrawable(R.drawable.icon));
tspec1.setContent(R.id.content);
tabs.addTab(tspec1);

return super.onOptionsItemSelected(item);
}

the output of above code consist of three tabs...now i want to show
different images on clicking on different tabs..
Please help

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to