All Questions
Tagged with android-actionbar android-viewpager
151 questions
0
votes
1
answer
98
views
How to change actionbar menu button with click on tab
There is 2 tab in activity first is image and second is video i want when there is image tab the menu button will be image on actionbar and when click on video tab the button change into video button. ...
0
votes
1
answer
133
views
ViewPager under ActionBar in RelativeLayout
ViewPager is below ActionBar. How can I make it under it?
layout:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:...
0
votes
1
answer
23
views
how to evenly layout the tab title using ActionBar (Android)
I have a ViewPager and 3 tabs/fragments are attached to it. It's noticed that when switch between tabs, the title text of either far left or right tab will be cut. I would like to have the tab titles ...
3
votes
4
answers
97
views
Actionbar setTitle() is working only once in OnPageChangeListener()
I have used viewpager and when the page is changed , the title will be changed based on the position.
This is my code inside onCreate()
setContentView(R.layout.activity_single_news);
Toolbar ...
1
vote
2
answers
1k
views
<activity> windowSoftInoutMode is not working for fragment which is in ViewPager
I have an Activity which shows contact details of a person. it contains CordinatorLayout (containing header), ViewPager in it along with TabLayout.
one of the fragment contains EditText at the bottom ...
0
votes
1
answer
745
views
ActionBar Title with Fragments/ViewPager - Title shown for wrong Fragment
I've looked around for a couple days trying to figure this issue out and I can't seem to narrow it down to my specific problem.
I have an app that makes use of 4 Fragments, the usual ...
-1
votes
2
answers
766
views
ActionBar and ViewPager
I'm trying to implement a simple app with tabs. I'm using ViewPager and TabLayout. The problem is that I can't understand why there is no ActionBar. Here is my code:
MainActivity:
public class ...
2
votes
4
answers
2k
views
Android collapsing Action bar with swipeable tabs
I'm trying to achieve a page as shown in the link. Can anyone please help me how to get it.
0
votes
1
answer
2k
views
Changing Actionbar Title when a tab is swiped
so i set up a Tab Acitivty in my project but the thing is i want to change my ActionBar title based on whichever tab that is active.
i have all class in single file (default from android studio), i'...
2
votes
0
answers
746
views
Actionbar(toolbar) of fragment in ViewPager not showing
I am trying to inflate Fragments inside ViewPager. When first it inflate it's calling onCreateOptionMenu() but not inflating the toolbar.
Once the ViewPager hit setoffscreenpagelimit number of ...
2
votes
1
answer
162
views
How to show viewpager fragment position on action bar?
I have nine fragments in viewpager. I want to show fragment position on action bar means if user working on fifth fragment then I want to show 5 on right corner of actionbar. I am using below code ...
0
votes
1
answer
141
views
Android FragmentStatePagerAdapter setSupportActionBar()
I used FragmentStatePagerAdapter to navigate between fragments with the same layout. In a fragment's onActivityCreated(), I set the activity's action bar to the current fragment's toolbar. The problem ...
0
votes
0
answers
300
views
Where to call invalidateOptionsMenu() while using ViewPagers
I am using a ViewPager along with a FragmentPagerAdapter to swipe through tabs and I want each fragment to display a different Options Menu.
I have the code in the onPrepareOptionsMenu() method for ...
1
vote
2
answers
129
views
set actionbar title from fragmet
I am using I am using view pager and fragments in my project,
I am trying to set title of Actionbar from fragment class.
My following code showing title of next fragment on current visible fragment.
...
0
votes
1
answer
38
views
Custom position of Actionbar Tabs
Is there way how to set custom position of Actionbar Tabs? Or set the layout like in the picture?
1
vote
0
answers
75
views
Quick Return actionBar with viewPager not working as expected
I wanted to implement a Quick Return actionBar with viewPager.
I have a scrollView in my main fragment of viewPager. The scrollView contains a textView with some random long text. I tried using this ...
0
votes
1
answer
1k
views
Set toolbar to FragmentActivity
There are similar lots of questions which I obviously tried but didn't help.
Followed by the Splash screen my app shows an activity with viewPager. I called this activity FragmentContainer because it ...
0
votes
3
answers
96
views
getActionBar returns NPE
I have a main activity with actionbar. at run time, despite the actionbar object is initialised to getActionBar(), i receive NPE with the logcat
output below
main activity:
public class MainActivity ...
2
votes
3
answers
4k
views
ActionBar.TabListener is deprecated what should use instead
I am trying to use ViewPager with ActionBarTabs. I referred to some examples and followed them. but the TabListener and ActionBar.Tab used in the below code are deprecated and i do not know what ...
0
votes
0
answers
106
views
Android ViewPager for Screen Slides don't show ActionBar
I'm try to make a tutorial by using the ViewPager fro Screen Slide and i'm following this GUIDE Using ViewPager from Developer.
I download the example code from the link and i want make something ...
-1
votes
1
answer
299
views
How to create custom action bar with ViewPager and navigation drawer(left side)
How to create custom action bar with view pager and navigation
drawer(left side). Please help me I have done logic for everything. But i
am not getting solution for how to include custom action bar ...
0
votes
0
answers
47
views
Add fragment in fragment from ViewPager
I have a ViewPager with fragments. I want to add a new fragment in the first and added back button in the ActionBar. If you can offer me the idea to realization. Thanks!
1
vote
2
answers
468
views
Error with my toolbar while creating tabs
I am using an androidhive tutorial to design my tabs since the tabhost has been deprecated. It is my first time using the new features. However, I keep getting this error:
java.lang....
1
vote
0
answers
91
views
Action Bar of Tabs at the top and Bottom, should work together
I want Action Bar at the Top as well as at the bottom, both should works together.
that the effect that comes to topped tab, should also be on the bottomed tab.
I have designed this one, works ...
1
vote
1
answer
1k
views
Overlap ViewPager tabs with a RelativeLayout
I have an Activity which contains a ViewPager with two tabs. When the user presses a button, I want an opaque RelativeLayout overlay to appear where the user can then select different options.
The ...
0
votes
1
answer
645
views
How to get Support Action Bar inside a Master/Detail Fragment to set NAVIGATION_MODE_TABS?
Right now I have a typical master/detail pattern, inside detail area I am supposed to display some kind of Tabs structure but with a ViewPager in order to implement the swipe functionality to change ...
0
votes
0
answers
231
views
Set ActionBar on ViewPager embed within a Fragment
I'm trying to set an ActionBar on a ViewPager embed within a fragment, which is updated when i use a DrawerLayout.
The problem is, when i call the final ActionBar actionBar = getActivity()....
4
votes
1
answer
514
views
Second set of tabs in an Android fragment
I want to add a second row of tabs to my Android application on the second fragment accessed from the ActionBar tabs.
Tab 1 shows fragment 1.
Tab 2 shows fragment 2 but I would like fragment 2 to ...
0
votes
0
answers
2k
views
ActionBar error "incompatible types"
I am stuck with making tabs using ActionBar. When I make it to run app with some code changes, my app crashes instantly without even starting. The current code is closest to working where I could get. ...
0
votes
2
answers
2k
views
How to get & use Widget Element's Action in fragment android
In need of a good Ui design for my app with tab layout, i searched in google and i found one UI which is using View Pager and Action bar Tabs.
Link is:
http://www.androidhive.info/2013/10/...
0
votes
1
answer
452
views
Android Effective Navigation Example . The Fragment is created multiple times
I was playing around standard Effective navigation example of Android which shows how to create swipeable views
The code can be downloaded from the following page :
http://developer.android.com/...
5
votes
5
answers
9k
views
Setting action bar title in ViewPager
My ViewPager consists of many fragments .I am displaying title of fragment inside actionBar and i am using below code to set title .Since the ViewPager also initiates adjacent fragments I see in ...
0
votes
1
answer
1k
views
Using Android setDisplayShowCustomEnabled(true) and ViewPager
I'm using a custom view for my actionbar and a viewpager with for fragments in the adapter. When I first load the activity, everything is perfect. Until I start swiping through the pageview then ...
1
vote
0
answers
58
views
On Android device ActionBar is not displayed for first and last tabs which are added dynamically
When the Activity is instantiated for my Android App, a ViewPager and a FragmentPagerAdpter are also created.
Initially Fragment1 for Tab1 is created. When onCreateView() is called for Fragment1, ...
0
votes
1
answer
126
views
How to change a TextView Fragment by a button located on the ActionBar (In the main fragment)
I have a main FragmentActivity (InfoInstalacionDetailsCollection extends FragmentActivity implements ViewPager.OnPageChangeListener) with ViewPager.
When the viewPager is in the Fragment number 4 (...
2
votes
2
answers
761
views
Null pointer errors in mainActivity for building swipe view with tabs on Android studios
I am looking to build the swipe view with tabs function in my application by following a tutorial that I found on one of the answers in the forum
[http://www.androidhive.info/2013/10/android-tab-...
0
votes
0
answers
53
views
Android Action Bar with Tabs
I'm trying to make an app with an action bar and tabs. The user should be able to swipe between the tabs. Each tab has different content (via fragments).
What is the best method to use?
How can I ...
0
votes
1
answer
283
views
NAVIGATION_MODE_TABS and ViewPager not working properly in landscape orientation
I have an activity which contains a viewpager to swipe across 4 fragments.
I'm also using ActionBar.NAVIGATION_MODE_TABS to display the tabs name and allow navigating by pressing on on the tab as well ...
0
votes
1
answer
116
views
Custom ActionBar and gettext from EditTetfrom ViewPager
I have Activity that contains custom ActionBar and ViewPager with three tabs.
I am not able to read text from EditText inside tab when click on button in ActionBar.
EDITED:
Contains TABS...
public ...
3
votes
3
answers
13k
views
How to change Viewpager tab colour dynamically?
How to change colour of Tabs like this? When I click/swipe to green or any other tab, the tab colour should change to that appropriate colour and rest of other tabs colour should change to black. ...
2
votes
2
answers
2k
views
How to dynamically set number of swipeable tabs in Action Bar with Fragments at runtime
I am referring this link for swipeable tabs using fragments. It worked for me, but what if I need to add the number of tabs dynamically and not pre assign the number of tabs? For instance, some of my ...
3
votes
4
answers
6k
views
Show menu items depending ViewPager Android
I have a ViewPager with fragments in my Android app. I want to show Action Bar menu item depending the fragment of the ViewPager. I have readen some questions about this but I can´t find the correct ...
0
votes
0
answers
187
views
calling asynctask in onCreateView from actionBar.addTab(tab,true) only hooks into the last called onPostExecute
So the issue I'm having is that I loop over a list of tabs, and call
actionBar.addTab(t,true) //which will force the app to basically call onTabSelected() for each tab
each tab then instantiates a ...
0
votes
1
answer
845
views
onTabSelected FragmentTransaction show not showing
So when I first start up my activity the code will populate each tab, and the actionBar.addTab(tab,true) will call on TabSelected which will then add each fragment. When I physically click on a tab it ...
1
vote
1
answer
155
views
I want to add fragments to each corresponding actionbar tab at the same time
UPDATE : I don't understand why when tapping on each tab onTabSelected() doesn't show the correct fragment even though it's been added to the fragmentTransaction android.R.id.content.
I call this ...
3
votes
3
answers
7k
views
How do the animation hiding the ActionBar and keeping tabs?
In version 5 of Google Play Store app, scroll to the content, ActionBar on with scrolling, but the tabs are fixed to get on top.
How to do this?
BEFORE SCROLL
AFTER SCROLL
2
votes
2
answers
2k
views
display ViewPager (swipe tab) below Relative layout (not attached to ActionBar )android
I have layout which has some views (EditText and Textview inside RelativeLayout ) and below I need to display ViewPager ( swipe tab ), but android supports ViewPager attached to ActionBar , which is ...
1
vote
1
answer
199
views
get menu from ListFragment
My MainActivity have 3 different ListFragment (each has their own java file) which I can navigate through swiping left and right. There is an EditText that I want to access on Action Bar. How can I ...
0
votes
1
answer
763
views
fragment in view pager not working properly
I implemented view pager in my activity like :
class MainActivity extends FragmentActivity implements
ActionBar.TabListener {
private ViewPager viewPager;
private TabsPagerAdapter ...
0
votes
1
answer
77
views
Constructor is undefined?
Why I am getting this error The constructor MyTabsPagerAdapter(FragmentManager, List<Fragment>) is undefined.
the code below contains the imports and how i instantiate theMyTabsPagerAdapter ...