android-tabhost

Android how to putExtra to an activity from TabHost activity?

梦想的初衷 提交于 2019-12-23 18:53:21
问题 I have a little problem with sending an extra from one activity to another. I have let's say FirstActivity which starts TabActivity , where I have 5 tabs. When I send putExtra() , from FirstActivity to TabActivity , there is no problem, but I need to send that extra to the Activity , which holds first tab of TabHost . I'm using this code : TabActivity.class : int collId = getIntent().getIntExtra("collection_id", 0); Log.i("Collection ID","Collection ID from SingleCollection.class : "+collId);

Custom Android TabHost Slow Fragments

≯℡__Kan透↙ 提交于 2019-12-23 12:29:26
问题 I use ActionbarSherlock and SlidingMenu. My MainActivity does not access a DB and no Parsing of what ever. Everything is static. Tabs are generated dynamicly depending on the "Section" you choose from the SlidingMenu. After 2 click the app becomes awefully slow. Below is my main view. <TabHost android:id="@android:id/tabhost" android:layout_width="match_parent" android:layout_height="match_parent" > <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android

What's the state of a pressed Tab in Android

别说谁变了你拦得住时间么 提交于 2019-12-23 03:38:15
问题 I'm trying to get my tabicon to change when a tab is pressed (i.e. when it changes color when you press the tab, but haven't released yet). I've created a selector as follows: <?xml version="1.0" encoding="UTF-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <!-- Non focused states --> <item android:state_focused="false" android:state_selected="false" android:state_pressed="false" android:drawable="@drawable/ic_tab_icon1" /> <item android:state_focused="false"

Android long click on tab

这一生的挚爱 提交于 2019-12-23 03:14:31
问题 I have a TabHost with some tabs, and after doing a long press on a tab, I want to get the position or the tag of the tab which was long pressed, and not the current tab that is showed. Below there is some code in which I create the long press listener for the TabHost: myTabHost.getTabWidget().getChildAt(i).setOnLongClickListener(new OnLongClickListener() { @Override public boolean onLongClick(View v) { // TODO Auto-generated method stub return false; } }); Any solution? Is correct to apply

Set color tab host indicator

这一生的挚爱 提交于 2019-12-23 02:31:35
问题 How do you set the color of the tab host indicator color I want to change the light blue default color to lets says RED. And I need to this programatically as I am making the tabs programatically. I did some research and looked at this example but it does not work for me. With the progamtic approach. TabWidget current tab bottom line color Thanks 回答1: You can do this programmatically, even change the color as you want, by following the solution in the linked question you mention, plus adding

Start Android App in a specific tab

我的梦境 提交于 2019-12-22 21:21:08
问题 The question is: I have a TabHost with 4 tabs (see code below) and I got a Button in MainMenuActivity class. The Button is set up with a OnClickListener and if it is clicked I want it to go to the second tab. I have tried with setCurrentTab(1) but that just messed the project up. What can I do? public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); setTabs() ; } private void setTabs() { addTab("Home", R.drawable.tab_home,

android custom font for tabs

守給你的承諾、 提交于 2019-12-22 11:28:41
问题 I would like to have a custom font for my tabs. Here's what I have tried: <style name="CustomTabWidgetText" parent="@android:style/TextAppearance.Widget.TabWidget"> <item name="android:textSize">14sp</item> <item name="android:typeface">@assets/fonts/heartbre</item> <item name="android:textStyle">bold</item> </style> But I got an error in <item name="android:typeface">@assets/fonts/heartbre</item> . Has anybody here tried customizing the font of tabs? 回答1: The only (currently) available way

How to Implement Android tab menu without deprecated tabhost

狂风中的少年 提交于 2019-12-22 08:28:38
问题 My question sounds simple, but I can't seem to find a sufficient answer for this. I'm trying to design an app for tablets that has some information at the top quarter of the screen, and then a tabbed menu for information below the top quarter. Basically what I'm looking for is : ┌───────────────────────────────────── │ │ Top of Page │ ├───────┬───────┬───────┬───────┬───── │ Tab 1 │ Tab 2 │ Tab 3 │ Tab 4 │ │ └───────┴───────┴───────┴───── │ │ Bottom of page │ │ │ ⁞ I was originally going to

Android FragmentTab host and Fragments inside Fragments

走远了吗. 提交于 2019-12-22 05:31:56
问题 I have an app with hierarchy like this: FragmentTabHost (Main Activity) - Fragment (tab 1 content - splitter view) - Fragment (lhs, list) - Framment (rhs, content view) - Fragment (tab 2 content) - Fragment (tab 2 content) All fragment views are being inflated from resources. When the app starts everything appears and looks fine. When I switch from the first tab to another tab and back again I get inflate exceptions trying to recreate tab 1's views. Digging a little deeper, this is what's

Android FragmentTab host and Fragments inside Fragments

流过昼夜 提交于 2019-12-22 05:31:52
问题 I have an app with hierarchy like this: FragmentTabHost (Main Activity) - Fragment (tab 1 content - splitter view) - Fragment (lhs, list) - Framment (rhs, content view) - Fragment (tab 2 content) - Fragment (tab 2 content) All fragment views are being inflated from resources. When the app starts everything appears and looks fine. When I switch from the first tab to another tab and back again I get inflate exceptions trying to recreate tab 1's views. Digging a little deeper, this is what's