android-tabhost

Tabhost bottom border line android

百般思念 提交于 2019-12-01 07:34:30
screenshot Notice that little tiny gray line that runs underneath the tabs (Except selected tab)? How do I change/alter that? Would that be part of the FrameLayout, tabHost or TabWidget? I just cannot find a way to alter or remove this little gray line. Thanks Ramindu Weeraman Create tabindicator.xml as following. Then insert following code in to your TabActivity class. ... View indicator1 = getLayoutInflater().inflate(R.layout.tabindicator, null); im1 = (ImageView) indicator1.findViewById(R.id.icon); im1.setBackgroundDrawable(getResources().getDrawable( R.drawable.home)); View indicator2 =

Tabhost bottom border line android

ぐ巨炮叔叔 提交于 2019-12-01 05:22:25
问题 screenshot Notice that little tiny gray line that runs underneath the tabs (Except selected tab)? How do I change/alter that? Would that be part of the FrameLayout, tabHost or TabWidget? I just cannot find a way to alter or remove this little gray line. Thanks 回答1: Create tabindicator.xml as following. Then insert following code in to your TabActivity class. ... View indicator1 = getLayoutInflater().inflate(R.layout.tabindicator, null); im1 = (ImageView) indicator1.findViewById(R.id.icon);

Calling camera app recreates android activity

元气小坏坏 提交于 2019-12-01 04:13:05
问题 I am working on a tabbed activity which is implemented using ActivityGroup. When I call the camera app and returns back its always calling onCreate() and recreates the activity. Because of this the callback to onActivityResult is having a null data. I am adding this inside manifest file. But no change. android:screenOrientation="portrait" android:configChanges="orientation|keyboardHidden" I am having this issue only on samsung galaxy s3. I have tested the same on galaxy s2,HTC, galaxy nexus.

Add Image or style to each tab

萝らか妹 提交于 2019-12-01 01:50:29
i have app with many tabs, i want to add image or style to each tab , how please? th = (TabHost) findViewById(R.id.tabhost_template_two_tabs); th.setup(); // all tab spec = th.newTabSpec("All"); spec.setIndicator("All"); spec.setContent(R.id.tab_template_two_tabs_all); th.addTab(spec); // favorite tab spec = th.newTabSpec("Favorite"); spec.setIndicator("Favorite"); spec.setContent(R.id.tab_template_two_tabs_favorite); th.addTab(spec); th.setCurrentTab(1); Thanks Try this : Call this from your OnCreate() method: setTabs(); Then put this code private void setTabs() { addTab(R.drawable.ic_icon1,

setCurrentTab of a tabHost

偶尔善良 提交于 2019-12-01 01:43:38
I'm asking if we can call a setCurrentTab on a tabhost from another class than the class that contains the tabhost and tabspecs? Can we put tabHost.setCurrentTab(1); in another class than this one : public class Main extends TabActivity{ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Log.v("", "Welcome in Main"); setContentView(R.layout.tab); TabHost tabHost = (TabHost)findViewById(android.R.id.tabhost); // Le TabHost a des Tabs TabSpec firstTabSpec = tabHost.newTabSpec("tid1"); // TabSpec: new tab - TabSpec : setContent to the tab firstTabSpec

how to Keep Tabhost when start other activity

一曲冷凌霜 提交于 2019-12-01 01:41:48
I have a problem with TabHost... I have TabBarActivity class flow as : public class TabBarActivity extends TabActivity implements OnTabChangeListener{ /* * (non-Javadoc) * * @see android.app.ActivityGroup#onCreate(android.os.Bundle) */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_CUSTOM_TITLE); setContentView(R.layout.layout_tab); TabHost tabHost = (TabHost) findViewById(android.R.id.tabhost); TabSpec mTab1 = tabHost.newTabSpec("tab1"); TabSpec mTab2 = tabHost.newTabSpec("tab2"); mTab1.setIndicator("TAB1")

What are the official Android recommendations for tabs?

徘徊边缘 提交于 2019-12-01 00:46:47
I have to say I'm pretty lost when it comes to designing tabbed layouts on Android right now. The platform developers seem to be evolving the design faster than I can figure out their intentions. From what I can gather from the combination of the recently deprecated TabActivity and the new design guide , I think they intend for tabs to be exclusively with the Action Bar, either inside the main action bar or stacked on a secondary action bar. Though the developer's guide suggests using the Action Bar for "global navigation". Does this mean that it's recommended to create your own tabs outside

how to Keep Tabhost when start other activity

99封情书 提交于 2019-11-30 21:02:27
问题 I have a problem with TabHost... I have TabBarActivity class flow as : public class TabBarActivity extends TabActivity implements OnTabChangeListener{ /* * (non-Javadoc) * * @see android.app.ActivityGroup#onCreate(android.os.Bundle) */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_CUSTOM_TITLE); setContentView(R.layout.layout_tab); TabHost tabHost = (TabHost) findViewById(android.R.id.tabhost); TabSpec mTab1

setCurrentTab of a tabHost

荒凉一梦 提交于 2019-11-30 20:56:54
问题 I'm asking if we can call a setCurrentTab on a tabhost from another class than the class that contains the tabhost and tabspecs? Can we put tabHost.setCurrentTab(1); in another class than this one : public class Main extends TabActivity{ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Log.v("", "Welcome in Main"); setContentView(R.layout.tab); TabHost tabHost = (TabHost)findViewById(android.R.id.tabhost); // Le TabHost a des Tabs TabSpec

Android: How to call function of Activity inside of tab from the tabhost

自古美人都是妖i 提交于 2019-11-30 20:26:16
I have a tabhost with three tabs. Each is an activity. I would like to have a button which is in the action bar, the bar along the top with common buttons, call functions of the tab which is active. For example, an add function which could add something different to each tab depending on what tab was present when you clicked the button. So, I am aksing how to call a function in Activity A from the tabHost. And if that wont work, perhaps I can update the database from the tabhost and then refresh the tab content. Would that be easier? Thank you all for you time and support. Hi Just stumbled