android-tabhost

TabGroupActivity - startChildActivity - not working

孤者浪人 提交于 2019-12-11 19:27:50
问题 I have been using TabActivity and I want the tab to display on every child activity. I have flow like this MainActivity(TabActivity) -> TabGroupActivity1(TabGroupActivity) -> Activity1 -> Activity2 Now i want to redirect on Activity2 only if the flag is true. so that my code for that is something like bellow. TabGroupActivity public class TabGroupActivity extends ActivityGroup { private ArrayList<String> mIdList; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate

Unable To Access library activity in another project

匆匆过客 提交于 2019-12-11 19:20:22
问题 I am trying to access library activity into another project(In tabhost and each tab call different activity.) but its throwing exception Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.themontcalm.droid.activity/com.themontcalm.droid.lib.activity.ReservationTab}; have you declared this activity in your AndroidManifest.xml? where :- com.themontcalm.droid.lib.activity.ReservationTab is a library project. And com.themontcalm.droid.activity

Admob ads will not display when placed inside a tabview

纵饮孤独 提交于 2019-12-11 16:51:58
问题 I've been trying to get my ads to display in this type of layout. Tabs -> LinearLayout -> ListView -> header. The header is set via addHeaderView and is displaying normally. If I were to move the ads anywhere else they display normally (so its not a setup issue). Using ads in the header of a listview works fine in my other projects. So this seems to be a very specific problem, the ads simply refuse to display when placed in the header of a listview inside a tabhost. My logs show no activity

how do I findviewbyid of a view inside a tabhost from an activity thats inside the tabhost?

感情迁移 提交于 2019-12-11 16:27:08
问题 I'm trying to retrieve a view but it keeps returning null, how do I find it? public class TripDailyItinerary extends Activity { ViewGroup layout; View v; @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.html_content); TextView content = (TextView) findViewById(R.id.htmlContent); layout = (ViewGroup) findViewById(R.layout.trip_content); v = (View) layout.findViewById(R.id.bg); //where

Help Using OnTabChangeListener

此生再无相见时 提交于 2019-12-11 16:15:18
问题 I have an app that is using 3 tabs and each has its own activity. There is also a main class that declares all the tab intents and such. My problem is that I need to use this in each individual activity: tabHost.setOnTabChangedListener(new OnTabChangeListener(){ public void onTabChanged(String tabId) { if("TAB_1".equals(tabId)) { webview2.reload(); } if("TAB_2".equals(tabId)) { webview2.reload(); } }}); I cannot use this because tabHost cannot be resolved, is there a way to pass this through

Android inflate framelayout inside tabcontent

巧了我就是萌 提交于 2019-12-11 16:07:08
问题 I need yours help to resolve simple issue . How dynamically "connect" or inflate layout into Tab content. I want project with TabsHost . For each tab I like different layouts. Very simple:) I am creating default android project : <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.tabtest" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="18" />

Switch back to previously selected tab after the activity is recreated

情到浓时终转凉″ 提交于 2019-12-11 15:46:12
问题 In my TabActivity the user may be asked to switch to browser activity for OAuth phase, and if the phase takes too much time, my activity will be killed. After the user switches back to my activity, its onCreate() method is invoked again and tabs are recreated. So I would like to know if there is any simple way to switch back to previous tab, and keep the tab as what it was. For example, one of the tab views contains a ViewSwitcher child, and I want to switch back to the switched view after

Call fragment function over activity

眉间皱痕 提交于 2019-12-11 14:39:17
问题 I have a TabLayout with 3 tab.They are a fragment. Test.java->PagerAdapter.java->TabFragment1+TabFragment2+TabFragment3 I want to call TabFragment1.helloworld() function. How can i call this function? Thanks. Test.java created 3 tabs in below Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); TabLayout tabLayout = (TabLayout) findViewById(R.id.tab_layout); tabLayout.addTab(tabLayout.newTab().setText("tab1")); tabLayout.addTab(tabLayout.newTab().setText("tab2

How to change content of a Tab while switching

人盡茶涼 提交于 2019-12-11 13:06:14
问题 I am following one book tutorial. While developing it, I come across a typical problem. I need to know that how should I change my content of a Tab while I move from one tab to another? thanks for any suggestions. 回答1: Here is a nice tutorial of TabActivity you are looking for, Tab Example For changing the icon of selected tab you have to create an xml for each tab like this in drawable folder first_tab.xml <item android:state_selected="false" android:drawable="@drawable/tab_unselected_icon"/

tabhost /tabbar icons not showing

时光怂恿深爱的人放手 提交于 2019-12-11 11:39:35
问题 my tab bar icon wont show up TabHost tabHost = getTabHost(); TabSpec barcodeInsertSpec = tabHost.newTabSpec("Barcode Insert"); barcodeInsertSpec.setIndicator("Barcode Insert", getResources().getDrawable(R.drawable.home2)); barcodeInsertSpec.setContent(new Intent(getBaseContext(), BarcodeInsertActivity.class)); tabHost.addTab(barcodeInsertSpec); drawable/home2.xml <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <!-- When not selected