android-tabhost

How to create app bar with icons using TabLayout Android Design?

旧街凉风 提交于 2019-12-02 18:07:06
I'm trying to use the new TabLayout in the android design library to create app bar with icons. public void setupTabLayout(TabLayout tabLayout) { tabLayout.setTabMode(TabLayout.MODE_SCROLLABLE); tabLayout.setTabGravity(TabLayout.GRAVITY_CENTER); tabLayout.setupWithViewPager(mViewpager); tabLayout.getTabAt(0).setIcon(R.drawable.ic_tabbar_library); tabLayout.getTabAt(1).setIcon(R.drawable.ic_tabbar_recents); tabLayout.getTabAt(2).setIcon(R.drawable.ic_tabbar_favorites); tabLayout.getTabAt(3).setIcon(R.drawable.ic_tabbar_notifications); tabLayout.getTabAt(4).setIcon(R.drawable.ic_tabbar_settings)

Android Activity call another Activity method

北战南征 提交于 2019-12-02 13:14:01
A TabActivity start other activity when i click on a tab, How to send information to parent (tabActivity) and don't finish current activity? My tabactivity start another activity like this : mTabHost.addTab( mTabHost.newTabSpec(TAB_OPTIONS) .setIndicator(TabImgFond5) .setContent(intentOptions)); Inside my new Activity Option, i would like to Call method of Tabactivity, is it possible ? Thanks Call getParent() from the tab's activity to get at the TabActivity . 来源: https://stackoverflow.com/questions/2992656/android-activity-call-another-activity-method

Tabhost error in getting in to my activity

核能气质少年 提交于 2019-12-02 13:00:32
When I am trying to get the tab host in my activity it is showing the error that do you forget to call public void setup(LocalActivityManager activityGroup) ? public class MainActivity extends FragmentActivity { private Resources res; private TabHost tabHost; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // tabHost = getTabHost(); TabHost tabHost = (TabHost) findViewById(android.R.id.tabhost); tabHost.setup(); res = getResources(); Intent intentContact = new Intent().setClass(this, tabOne_Activity.class);

ProgressDialog in Tabhost Not Working

淺唱寂寞╮ 提交于 2019-12-02 12:10:54
问题 i use three progress dialog in my activity OnCreate() When navigating to next page When navigating to previous page but after first time when I click next page button the application crashes with error WINDOW LEAKED Here is my code kindly someone please tell what i am doing wrong public class Request_Movies_Conatiner_Activity_REQUESTS extends Activity implements OnClickListener{ String webrss, totalMovies; ProgressDialog dialog; ListView RequestedMoviesListView; RequestMoviesCustomAdapter

Android - How to create tabs on demand using existing layout?

ⅰ亾dé卋堺 提交于 2019-12-02 11:15:36
Compulsory background info: I'm building a tablet app for real estate agents to use when quoting homes and buildings. Since a home or an apartment can have any number of rooms, I thought it would be nice to build a tab-based solution that allowed for going room by room and creating one tab per room on demand. I've been through several tab tutorials but all solutions I've found deal with a predefined number of tabs, and use the deprecated TabHost. TabHost.TabSpec ourSpec = tabhost.newTabSpec("tag1"); ourSpec.setContent(new TabHost.TabContentFactory() { @Override public View createTabContent

SupportMapFragment issue in nested TabHost Fragment

荒凉一梦 提交于 2019-12-02 09:56:42
I have 1 FragmentActivity 1 main fragment and 2 tabshosted child fragment one is for listview another for map. I have 2 problems here. First one is that I have to prevent recreation of child fragments on every tabchanges. Second problem; the first time I click tab for map fragment map can be seen. but coming back to list fragment and return to map fragment map is not being showed. I am really have trouble with this part in my project. I need your guide. My all code is as below. Main(Parent) Fragment public class MainFragg extends Fragment implements OnTabChangeListener{ private FragmentTabHost

saving data on tabs

删除回忆录丶 提交于 2019-12-02 09:55:53
I have 3 tabs, each a separate activity. I want to save data when user clicks save on either of the tabs. There are couple of options available; shared preference, global variables or saving the objects in context. EDIT:I have to save an image & textfield Android Shared Preferences Store Objects in ApplicationContext Any suggestions on which method to pick ? thanks That is entirely dependent upon the length of time you wish to store them for. Storing in the Application Context will not persist data after the application has ended. It just stores in memory. Shared preferences is a possibility

Back button behavior with tabs and ActivityGroup

跟風遠走 提交于 2019-12-02 08:20:21
I have an Activity ( Main ) which shows tabs like this: private void initTabs(){ mTabHost = getTabHost(); // The activity TabHost Intent intent; intent = new Intent().setClass(this, MyGroup.class); setupTab(intent, "tab"); } private void setupTab(Intent intent, final String tag) { View tabview = createTabView(mTabHost.getContext(), tag); TabSpec setContent = mTabHost.newTabSpec(tag).setIndicator(tabview).setContent(intent); mTabHost.addTab(setContent); } private static View createTabView(final Context context, final String text) { View view = LayoutInflater.from(context).inflate(R.layout.tabs

ProgressDialog in TabHost application ofandroid

孤街醉人 提交于 2019-12-02 06:31:06
I want to use the Progress Dailog in my application. I am facing one issue in doing it, after some RnD I came to know that it is not quite possible to create the progress Dialog I have the Activity Group Class for the TabHost in the application. I have exactly the same scenario, I have the TabHost in my application and an ActivityGroup Class that has the TabHost Classes. So, when I try to create the Progress Dialog for the Class that is in the Activity Group Class I cannot create it. But if I try to create the Progress Dialog for the Class that is not in the Activity Group I can create it with

TabHost inside a ScrollView forces it it to scroll to the bottom

核能气质少年 提交于 2019-12-02 03:15:26
问题 My question is very similar to this unanswered one, with some small differences that I will explain: TabHost inside of a Scrollview: always scrolls down when a Tab is clicked My ScrollView initiates scrolled to the bottom, showing the TabHost content instead of the ones on top of it (you can see the screenshots in the linked question, it's very similar). If I manually scroll up, clicking in different tabs doesn't affect the ScrollView, the problem is only in the first time it's shown. This is