android-tabhost

Is there any way to change android:windowSoftInputMode value from java class?

人盡茶涼 提交于 2019-11-26 12:08:04
问题 I want to act my tabs to have different windowSoftInputMode properties for each tab. How to access this property from java class when all handling of your tab is done from one single activity? Is there any way to access this manifest property from java code? 回答1: Use the following to change the softInputMode for an Activity. getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN); Use the following to change the softInput type for an EditText. mEditText.setImeOptions

android: using ActivityGroup to embed activities

江枫思渺然 提交于 2019-11-26 09:37:37
问题 Im in the conceptualizing/design phase of building an app and i\'ve hit a bit of a snag. Essentially i was looking for a way to embed one activity into the UI of another similar to how a TabHost/TabActivity. There would be a window at the top of the screen which would contain the other activity, and below that would be buttons and controls that are independent of the above activity and should always be visible. The user would be able to navigate from one activity to another in the window

Remove old Fragment from fragment manager

别说谁变了你拦得住时间么 提交于 2019-11-26 08:59:52
问题 I\'m trying to learn how to use Fragment s in android. I\'m trying to remove old fragment when new fragment is calling in android. 回答1: You need to find reference of existing Fragment and remove that fragment using below code. You need add/commit fragment using one tag ex. "TAG_FRAGMENT". Fragment fragment = getSupportFragmentManager().findFragmentByTag(TAG_FRAGMENT); if(fragment != null) getSupportFragmentManager().beginTransaction().remove(fragment).commit(); That is it. 回答2: If you want to

Android tabhost change text color style

大兔子大兔子 提交于 2019-11-26 08:25:34
问题 Trying to change tabhost text color, in this code I can change tabhost background color(not text color) tabHost.setOnTabChangedListener(new OnTabChangeListener() { @Override public void onTabChanged(String tabId) { for (int i = 0; i < tabHost.getTabWidget().getChildCount(); i++) { tabHost.getTabWidget().getChildAt(i) .setBackgroundColor(Color.parseColor(\"#FF0000\")); // unselected } tabHost.getTabWidget().getChildAt(tabHost.getCurrentTab()) .setBackgroundColor(Color.parseColor(\"#0000FF\"));

Android TabWidget detect click on current tab

隐身守侯 提交于 2019-11-26 08:08:04
问题 I am trying to find way to be able to fire an onclick event on a tab when this tab is the current tab. I did try this way (among several other) with no success thou. public void onTabChanged(String tabId) { Log.d(this.getClass().getName(), \">>>>>>>>>>>>>>>>>>>>>>>> tabId: \" + tabId); int tabs = getTabWidget().getChildCount(); Log.d(this.getClass().getName(), \"tabs: \" + tabs); for(int i=0; i<tabs; i++){ View tab = getTabWidget().getChildAt(i); if(i==tabHost.getCurrentTab()){ Log.d(this

How to change the Tabs Images in the TabHost

牧云@^-^@ 提交于 2019-11-26 08:06:29
问题 I am using the TabHost in my application, I am using four Tabs in my application and I want to use the different Images in the TabHost when the Particular Tab is been Selected and not selected. I need to use to different Images for a particular tab each. When I Select any Tab the Image is little bright and when I switch to another Tab that bright Image becomes grey shaded. I have implemented the TabHost but I don know how to change the Images in the TabHost. Can anybody help me in this.

How to change the font size of tabhost in android

那年仲夏 提交于 2019-11-26 07:29:31
问题 How can the font size of the tabs be changed? I extend TabActivity for the tabs. 回答1: You can define themes, use styles to achieve this: First you create the theme (name: CustomTheme ) for your Activity in your res/values/styles.xml : <style name="CustomTheme" parent="@android:style/Theme"> <item name="android:tabWidgetStyle">@style/CustomTabWidget</item> </style> <style name="CustomTabWidget" parent="@android:style/Widget.TabWidget"> <item name="android:textAppearance">@style

Android Exception: Did you forget to call &#39;public void setup (LocalActivityManager activityGroup)&#39;

柔情痞子 提交于 2019-11-26 06:37:33
问题 MyCode: public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); final TabHost tabHost = (TabHost) findViewById(R.id.tabhost); // LocalActivityManager mLocalActivityManager = new LocalActivityManager(this, false); tabHost.setup(); TabSpec tabSpecCheckIn = tabHost.newTabSpec(getResources().getText(R.string.button_check_in).toString()); tabSpecCheckIn.setIndicator(getResources()

Android: TabHost without TabActivity

自闭症网瘾萝莉.ら 提交于 2019-11-26 06:30:38
问题 I want to create tabs without extending TabActivity. (The reason is that TabActivity cannot handle a custom titlebar as it seems). I have public class startTab extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.mylayout); Resources res = getResources(); LocalActivityManager mlam = new LocalActivityManager(this, false); TabHost tabHost = (TabHost) findViewById(R.id.tabhost); tabHost.setup(mlam); TabHost

TabHost with Fragments and FragmentActivity

℡╲_俬逩灬. 提交于 2019-11-26 04:39:55
问题 I\'m working on an Android App and I want to use 3 tabs for navigation using Fragments for each tab, but I don\'t know how to create the structure for doing it. I want to add each fragment separately because each one is different, but I don\'t know where to add them in FragmentActivity. I have these files. tabs_layout.xml <LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\" android:orientation=\"vertical\" android:layout_height=\"match_parent\" android:layout_width=\