android-tabhost

How to reference child activity from TabHost to call a public function?

≡放荡痞女 提交于 2019-11-29 22:28:39
I have a TabHost with two child activities in it (in two tabs). I also implemented a public function in one of these activities that i would like to call from my parent (TabHost), to trigger some action within the tab. Is it possible to reference the activity itself from the TabHost to call a public function? Thanks here is my tabhost setup: res = getResources(); tabHost = getTabHost(); TabHost.TabSpec spec; Intent intent; intent = new Intent().setClass(this, home.class); spec = tabHost.newTabSpec("home").setIndicator("Groups", res.getDrawable(R.drawable.groups)).setContent(intent); tabHost

How to implement TabHost sliding effect? [closed]

荒凉一梦 提交于 2019-11-29 21:46:46
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . I need to create some TabHost form paging. There is sliding animation effects in TabHost column when switching options page. I want to implement the page also has sliding animation effects. How to so this? I

OnActivityResult is not working in TabActivityGroup?

蓝咒 提交于 2019-11-29 16:45:00
I am using Tab Activity as a main Activity in which it has 4 tabs. One tab is Activity Group which has three buttons. Each button is one activity. I am using camera in one of those activity. I know its working because i have checked in the memory card the image get saved, but it doesn't calling the Onactivityresult() method. This is to display the ContentView public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); View viewToLoad = LayoutInflater.from(this.getParent()).inflate(R.layout.enter_expenses, null); this.setContentView(viewToLoad); This code is used to

create custom tab in FragmentActivity

≡放荡痞女 提交于 2019-11-29 15:47:31
问题 i am trying to create custom tab in android , i have create the Tabs into FragmentActivity and FragmentPagerAdapter Here is the code of but i really don't know where do i inflate the custom tabs using View tabIndicator = LayoutInflater.from(mContext). inflate(R.layout.tab_item, mTabHost.getTabWidget(), false); code in onCreate method of FragmentActivity mTabHost = (TabHost)findViewById(android.R.id.tabhost); mTabHost.setup(); if(mTabHost!=null) System.out.println("***ITS NOT NULL****");

Honeycomb and TabHost specs

佐手、 提交于 2019-11-29 14:32:24
I have a question about Honeycomb's backward compatibility. I have an app that supports 2.1 or higher and seems to mostly work on Honeycomb except when they start a TabActivity. In particular, when I add tabs to the TabHost, I get the following exception android.content.res.Resources$NotFoundException: Resource ID #0x0 When looking at the code that throws this exception, I see that it's the tab spec that has a label and an icon. Inside the code, in the LabelAndIconIndicatorStrategy tries to inflate the layout file R.layout.tab_indicator which doesn't appear to be available. TabHost.TabSpec

FragmentTabHost & Fragments - How do I pass data between tabs?

ぐ巨炮叔叔 提交于 2019-11-29 11:11:44
I have a MainActivity (FragmentActivity) that has a FragmentTabHost. public class FragmentTabs extends FragmentActivity { private FragmentTabHost mTabHost; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.fragment_tabs); mTabHost = (FragmentTabHost)findViewById(android.R.id.tabhost); mTabHost.setup(this, getSupportFragmentManager(), R.id.realtabcontent); mTabHost.addTab(mTabHost.newTabSpec("classA").setIndicator("Class A"), ClassA.class, null); mTabHost.addTab(mTabHost.newTabSpec("classB").setIndicator("Class B"), ClassB

FragmentTabHost bottom TabWidget

天大地大妈咪最大 提交于 2019-11-29 05:19:54
Hello How I can create bottom TabWidget in FragmentTabHost ? My xml looks line this: <?xml version="1.0" encoding="utf-8"?> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <FrameLayout android:id="@android:id/tabcontent" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" > <FrameLayout android:id="@+id/realtabcontent" android:layout_width="match_parent" android:layout_height="fill_parent" /> </FrameLayout> <TabWidget android:id="@android:id/tabs" android:layout_width="match_parent"

How to implement horizontally scrollable tabs?

喜你入骨 提交于 2019-11-29 04:51:45
问题 I'm trying to implement this application. At the moment I have designed tabs on it and since I have more than 7 tabs it looks too congested. How can I design it so that the tabwidget is scrollable horizontally. I have seen this design on few of the apps at the market but no clue how to implement this in my app. One app I saw had a horizontal scrollview where it scrolls on its own and when you press the particular image/button it displays some content. It didn't seem to be tabs I guess. So

iPhone- like tab bar in Android?

我怕爱的太早我们不能终老 提交于 2019-11-29 02:35:18
问题 In iPhone we can create a view that has a tab bar and make it the root view of the application then use the tab bar to navigate through sub views. what is the most close approach to this in Android? Is it to use a Tabbed Control? but this includes using just one activity. what is the approach to use in Android to create an activity with a navigation control to other activities in a way similar to that of the iPhone? 回答1: There's a tutorial for creating a "Tab Layout" on the android dev site:

Background in tab widget ignore scaling

一曲冷凌霜 提交于 2019-11-29 00:47:01
I tried to use a background (480x320) for my tab content. Using a xml as drawable, I should be able to scale the image. This works fine outside the tabhost/tabactivity. If I try to use it inside the tabcontent, the scaleType doesn't work. He ignores every scaleType I tried. tabcontent: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/background"> <include layout="@layout/main_list" /> </RelativeLayout> background.xml in res