Initially I have 3 screens in a tab bar...but when I navigate from any of these activities to any other activity the tab bar disappears...I want this tab bar to appear even on that screen...How to do that??
You could put your tabbar code into a separate XML file (say, tabbar.xml) and use
<include layout="tabbar" />
in each of the layout files.
Then, you would need to set it up in your Activities onStart methods.
Related
In my Android app I'm using TabHost to work on some tab functionality. tab works fine. but in my app each tab contains several icons related to activities and when each activity starts it take over the whole screen. instead I want to show tabs when all the activities are running.
for instance take following screen as my tab view.
and when I click on the icon the second screen is as follow.
in there I can't see the tabs and in my case I wanna be able to see the tabs in the second activity too.
how can I implement this. can I use Fragments in this. Thanks and regards.
I have implement bottom bar as show below I achieved this using view flipper, its work perfect but when I select any one item to start new activity, its blink because of activity change.
I want to make this bottom-bar behave like as tab in which only tab change and it wont blink activity.
Design a seperate layout with the Bottom images and their behavior (like using selector etc to change state when you click on it ) and add that layout to your Activity XML using
<include> </include> tag
well, I have my Android app that have 4 main options. For that I created a TabActivity with this options.
Problem, when I enter to one of this, a activity is called. Cool. Imagine I have a list and when I click on one row I open other activity, the tab will disappear what is correct. But I want this tabBar always.
how can I achieve this?
if I copy/page this tab in every activity I need it it will load the ones that are attached to the tab and wont show the one that I opened before, right?
You should try with FragmentActivity. There is a addTab function to add tabs to action bar, in which you set tabs. With fragments and action bar what you want to do is possible
Take a look at Action Bar Sherlock that includes actionbar compatibiliy with tabs and more for non Honeycomb versions of Android.
I want to have an static bottom menu bar exist through out the applications in every page visible at bottom all the time. I have designed the menu bar but i am confused whether i have to integrate the menu code with every layout xmls to make menu visible in every page and write the code in every activity class to perform functions on menu clicks. Or if there is any other way i can create a common bottom bar that lies with every page with writing the code of menu in a single activity class.
Well the best way in my opinion , is to create a bottom bar xml file , and include it in every Activity's xml file
<include android:layout_width="fill_parent" layout="#layout/bottom_bar" />
where your bottom bar xml file name is bottom_bar.xml
This article also might help you
http://android-developers.blogspot.com/2009/02/android-layout-tricks-2-reusing-layouts.html
There is also the include route:
Common layout in all tabs
What you are probably looking for is one Activity with a TabBar with tabs at the top and buttons at the bottom: Android: Tabs at the BOTTOM
Then you can use different Views that correspond to Tabs instead of separate Activities.
My Android app is created with a tab bar and the root activity is extending TabActivity. The problem I have is that I always want the tab bar to be visible.
Lets say that one of the activitys in one of the tabs have a button and when I tap that button I want to open up a new activity with the following code:
Intent intent = new Intent(this, MyActivity.class);
startActivity(intent);
The new activity opens up in full screen over the tab bar. I want it to show up in the FrameLayout where I have the tab content so that the tab bar is still visible. I want to use an activity so that I can use back stack etc. This must be standard in an app using a tab bar, so what am I doing wrong here?
I'm not sure but i think that if you want the activity to display within the tab content you should declare a tabspec, like for regular tabs, or directly set the TabHost current tab to the tab/activity you want to display?
To create a tabbed layout you should use a TabHost and a TabWidget as described here.
Seems like it is like Cristian says, there is no good way of doing this
From what I understand from that post there is a way but it is a "hack" and that Android isn't built to use this idea of an UI.
I have some questions about this, though:
So if my app is divided into five different large parts, that is perfect to divide into tabs (like I do on the iPhone). How would you solve this UI in Android in a good way without a tab bar? Or should I use a tab bar but open up new activitys full screen?