i am trying to make an app, but i am facing some problems here.
My apps consist of a search banner which remains on the top of the screen, and below it is a tabwidget which allows the switch of the tabs. What i want is, to have the invoke an intent by clicking a button inside one of the tabs, and then it should appear the info i want.
The problem here is that the top banner suppose to be there goes missing after i call out another activity
_________________________
|Banner |
---------------------------------
|tab 1 | tab 2 | tab 3 | tab4|
---------------------------- -|
| (button) |
| |
---------------------------------
_________________________
|my stuff here my stuff here|
|my stuff here my stuff here|
|my stuff here my stuff here|
|my stuff here my stuff here|
|my stuff here my stuff here|
|my stuff here my stuff here|
|_______________________|
_________________________
|Banner |
---------------------------------
|tab 1 | tab 2 | tab 3 | tab4|
---------------------------- -|
|my stuff here my stuff here|
|my stuff here my stuff here|
|my stuff here my stuff here|
|_______________________|
This is how i made my tabs
- Code: Select all
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Resources res = getResources();
TabHost tabHost = getTabHost();
TabHost.TabSpec spec;
Intent intent;
// Find Tab
intent = new Intent().setClass(this, Find.class);
spec = tabHost.newTabSpec("FIND").setIndicator("FIND",
res.getDrawable(R.drawable.find)).setContent(intent);
tabHost.addTab(spec);
// Makan Tab
intent = new Intent().setClass(this, makan.class);
spec = tabHost.newTabSpec("MAKAN").setIndicator("MAKAN",
res.getDrawable(R.drawable.makan)).setContent(intent);
tabHost.addTab(spec);
And this is how ithe inside of one of my tabs
- Code: Select all
protected void onListItemClick(ListView l, View v, int position, long id) {
super.onListItemClick(l, v, position, id);
Intent myIntent = new Intent().setClass(this, Home.class);
startActivity(myIntent);
What happens when i run the code is that, the banner is no more there, and the new content takes over.
What i would like help with is some suggestions as to how to make sure the banner is still there after i call a new activity. I do not want to do it via hardcoding if it is possible.
I am looking for ways to correct this, and not looking for a free labour to help me do my work, thus i am not posting my code as i would rather do it myself with some hints.
In any case, thanks in advance and sorry for getting such a long post

