android-tabhost

Errors when using a FragmentTabHost inside a Fragment

我的梦境 提交于 2019-12-12 02:24:43
问题 Im' trying to add a FragmentTabHost inside a Fragment (which is the content of another tab widget. I used the following xml: <android.support.v4.app.FragmentTabHost xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/tabhost" android:layout_width="match_parent" android:layout_height="match_parent"> <LinearLayout android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <FrameLayout android:id="@android:id/tabcontent

Android TABS with fragments

一个人想着一个人 提交于 2019-12-12 02:12:22
问题 I've been working on a small project that consists of a GUI with a number of tabs. I'm quite new with the concept of fragments however it seems that they're a best practice within the android tab landscape. I managed to code a simple tab app, that switches between 3 tabs. The only issue I have is when I try placing the tabs at the bottom of the screen. When they're at the bottom, the tab widget covers the container(framelayout in this case) and so nothing happens, the screen remains the same

Calling method inbetween Fragments which are in tabs

夙愿已清 提交于 2019-12-12 02:03:51
问题 I currently have a few fragments which are all organised in tabs and i want fragment A to call a method in frag B. So I know I need to call the activity which then calls the function in B, I have seen people mentioning to use ExampleFragment fragment = (ExampleFragment) getFragmentManager().findFragmentById(R.id.example_fragment); fragment.<specific_function_name>(); I am having a problem though as my fragments are added with a tab listener not a fragmentmanager so I have no idea how to use

Android Error : No Tab known for Null Tag

我的梦境 提交于 2019-12-12 01:59:23
问题 I need a fixed area (around 20%) at top and then 3 tabs below it. The xml is mylist.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <LinearLayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="0.2" android:orientation="vertical" > <View android:layout_width="match_parent" android

Alternatives to using an activity for each tab

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-12 01:29:09
问题 The scenerio is like this. Currently I am using the following code TabSpec setContent = tabhost.newTabSpec("tab") .setIndicator("tabview") .setContent(new Intent(tabhost.getContext(), someActivity.class)); But I am told that each tab should not be associated with an activity and we must follow code something like this. TabSpec setContent = tabhost.newTabSpec("tab").setIndicator("tabView").setContent(R.id.layout) Consider a scenario where tab1 calls camera app, tab2 parses an XML and tab3 does

Close tab programmatically TabHost

℡╲_俬逩灬. 提交于 2019-12-12 01:21:49
问题 How can I close tab in TabHost? (My tab this Activity). When I try: tabHost.removeViewAt(tabHost.getCurrentTab()); My app crashs. 回答1: This should work: tabHost.getTabWidget().removeView(tabHost.getTabWidget().getChildTabViewAt(tab_index)); Where tab_index is the index of the tab that you want to remove. 来源: https://stackoverflow.com/questions/12587965/close-tab-programmatically-tabhost

TabHost tabs are not horizontally scrolling when swiping using ViewPager

安稳与你 提交于 2019-12-12 01:03:01
问题 I am writing an app that uses many fragments. I have used ActionBarSherlock (with ActionBar). To work-around bug #240, I've decided to switch a functionally working implementation to use ActionBarSherlock with TabHost . After half a few hours of work, it is working fine, except for when I am swiping between pages: The correspondent tab is selected, but is not centered and often not even visible so the user can't see which tab is selected. In the picture you can see the visible fragment (

New layouts in TabHost

坚强是说给别人听的谎言 提交于 2019-12-12 00:48:14
问题 I'm using tabHost in my application but in one of the views (corresponding to one of the tabs) I have a button that have to take me to another activity and then another layout. The question is: how do I get this new layout can continue to have access to the tabs? or better say, How do I load this new layout inside the FrameLayout ?. Here I have uploaded what I'm trying to do: http://imageshack.us/photo/my-images/541/exampleu.png/ Thanks in advance.! Pd: I'm new in Android, maybe is there a

android tabwidget need help

孤街醉人 提交于 2019-12-11 22:41:37
问题 hello i am creating an application i've created tabbar from pressing the first tab i am downloading a file and into second tab it lists all the downloaded files..i am downloading file using the asyncTask.. i want to do is,after pressing the button for the downloading file i want to show 2nd tab open that is the list of the all downloaded files how it can be possible ? this is my testclass.java that extends the TabActivity public void onCreate(Bundle savedInstanceState) { super.onCreate

I've changed tabs order, and now can't set actionbar sherlock properly

时间秒杀一切 提交于 2019-12-11 20:11:44
问题 In my project, I use actionbarsherlock to show a context menu at the upper side, and a tabhost to show navigate options at the bottom (each tab loads a fragment). At first, my default tab was one wich gets user's gps location and loads a map. The second tab was a list with several categories options. As I decided to swap this tabs (just by adding the categories tab first at the TabsAdapter), I started to have problems changing my actionbar. When my app first starts, I can see this "select