android-tabs

Switching between fragmentTabs giving unexpected results

爱⌒轻易说出口 提交于 2019-12-03 16:09:09
I am trying to implement FragmentTabs as illiustrated in http://developer.android.com/resources/samples/Support4Demos/src/com/example/android/supportv4/app/FragmentTabs.html . Everything went well until i did this: I started lots of different fragments from one tab like: tab1-->fragment1--->fragment2--->fragment3 tab2 But when i switched to tab2 and again came back to tab1, I got fragment1 screen not fragment3(i.e. I have 3 fragments in first tab and while i am on 3rd fragment and I come again on first tab after switching to second tab, I am taken to 1st fragment not 3rd)..Can anyone tell what

error with google maps v2 in tab (MapFragment in Fragment)

风流意气都作罢 提交于 2019-12-03 16:02:54
I have a fragmentActivity where I build a tabHost and in each tab there is a Fragment. Well, I haver four tabs 3 with info and 1 with a fragment where is included a google-map-v2 (is a fragmentMAp in a Fragment because I want to add buttons etc.), when I select one tab and pass to other everything go well, but when I select the map tab, after that other tab and again the map tab an error is throw. My view seems like: |__||__|__|__| | __________ | || FRAGMENT || ||_____ _ || || FRAG| |_||| || MAP | || || | || ||_____| || ||__________|| The error: 01-29 08:32:56.979: E/AndroidRuntime(27738):

How to show unread notification counter on Tabs inside TabLayout?

浪子不回头ぞ 提交于 2019-12-03 15:26:15
I am using TabLayout of android support design library. I want to show unread notification counter on the tab with title like below image. How to set unread count on Tab inside TabLayout ? Use public TabLayout.Tab setCustomView (int layoutResId) Create a Layout with TextView and Button use this in Custom view. For reference setCustomView Example Hope this will helpful to you. Take a look at android-viewbadger ... 来源: https://stackoverflow.com/questions/32269517/how-to-show-unread-notification-counter-on-tabs-inside-tablayout

how to set the tabs in the bottom of the screen in android?

风格不统一 提交于 2019-12-03 13:49:23
i am working on tabactivity. i wanna show my tabwidget below the tabcontent(framelayout). i done it by setting the tabwiget tab attribute as android:gravity="bottom" but the framelayout cant align with those tabs. that is the tabs are shown at the bottom of the screen and overlap the framelayout how to do that? if set some height value to the framelayout it not optimized for all screens of android. what can i do? any idea??? or just use a custom one from: http://code.google.com/p/androidtabs/ it allows tabs on the bottom The basic concept behind the Tab-Activity as follows TabHost is a

How to launch an activity with a specific tab?

不想你离开。 提交于 2019-12-03 09:03:48
I've gone through many examples, questions and tutorials but I've never seen an activity launch (launch a new intent) with a specific tab. I know that one can use .setCurrentTab to switch to a tab, but this can be done only from inside the parent activity tab. How about launching a specific tab contained in one activity from a different activity? Is it possible? If so, then how? In my code, on a standard activity launch user is shown the first tab, but I want him to go to the fourth tab in case he is being redirected from another activity. My TabHost code (MyTabActivity): int tabIndex = 0;

Android Scrollable Tabs + Swipe state when swiping

两盒软妹~` 提交于 2019-12-03 08:36:23
I'm trying to make an application with multiple Tabs. For each tab I'm using different fragments. And when I leaf through tabs the information in them is changing. How can I save the state of each tab when swiping? Code for example: MainActivity.java : package com.tabs.example; import java.util.Locale; import android.graphics.Color; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentActivity; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentPagerAdapter; import android.support.v4.view.PagerTabStrip; import

Icons in TabLayout

纵然是瞬间 提交于 2019-12-03 08:07:31
I have a simple AppCompatActivity with one simple Toolbar (android.support.v7.widget.Toolbar), one Design-Library TabLayout and one ViewPager . Now I have in this case 4 fragments which are inside the viewpager and can be swiped from the sides. That works fine. But as soon as I use mTabLayout.setupWithViewPager(mViewPager); , the icons disappear but I can tab on the empty spaces which works fine. If I remove the line, the icons are visible again, the "swipe" works but if I tab to an icon, nothing happens. My Code MainActivity public class MainActivity extends AppCompatActivity { private

How open tab in Espresso

匆匆过客 提交于 2019-12-03 07:37:12
How can i open tab in Espresso test? I tried to do Espresso.onView(ViewMatchers.withId(R.id.practice_results_tab)).perform(ViewActions.click()); , but that doesn't working. In that code i opened Layout of this tab. There is the XML file: <TabHost android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/practice_tabHost"> <LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical"> <TabWidget android:id="@android:id/tabs" android:layout_width="fill_parent" android:layout_height="wrap_content"> </TabWidget>

Android : Accessing container activity object from fragment using putExtra?

时光毁灭记忆、已成空白 提交于 2019-12-03 06:26:15
I am building a tab interface using Action bar and fragment. I would need assistance in sending data from container activity to the fragment. To elaborate, I have job object in container activty. And I have created few tabs based on the information in job object (like company details, experience details etc). I need to pass the job object to these fragments so that it can display respective information. I have created container activity and tab fragments. I would need an example on how to pass the object across them. I cannot use intent.putExtra. Can I access parent container's object from

How to set height of actionbar tabs for android

久未见 提交于 2019-12-03 06:15:35
Basically, I want to change the height of the tabs in actionbars. This questions has been asked several times on stackoverflow, for example: ActionBar tabs height I have tried most of the solutions but nothing work, here is my code. <style name="CustomActionBarTheme" parent="@android:style/Theme.Holo"> <item name="android:scrollHorizontally">false</item> <item name="android:paddingLeft">0dp</item> <item name="android:paddingRight">0dp</item> <item name="android:actionBarSize">80dp</item> <item name="actionBarSize">80dp</item> <item name="android:actionBarTabStyle">@style/ActionBarTabStyle<