android-viewpager

Viewpager tabs recreated?

与世无争的帅哥 提交于 2020-02-23 03:54:17
问题 I have implemented a NavigationDrawer with a few items in it. Every item represents a different Fragment and one of them has tabs. My problem is that every time I open this Fragment the tabs reloaded! and added to the previous tabs. Why is this happening and how can I solve it? This is the Fragment with the tabs: public class fragment_profilo_tabs extends Fragment implements ActionBar.TabListener { private ViewPager viewPager; private TabsPagerAdapter mAdapter; private ActionBar actionBar; //

Viewpager tabs recreated?

会有一股神秘感。 提交于 2020-02-23 03:53:10
问题 I have implemented a NavigationDrawer with a few items in it. Every item represents a different Fragment and one of them has tabs. My problem is that every time I open this Fragment the tabs reloaded! and added to the previous tabs. Why is this happening and how can I solve it? This is the Fragment with the tabs: public class fragment_profilo_tabs extends Fragment implements ActionBar.TabListener { private ViewPager viewPager; private TabsPagerAdapter mAdapter; private ActionBar actionBar; //

ScrollView Inside ViewPager Not Working

独自空忆成欢 提交于 2020-02-20 11:42:10
问题 i have an activity ViewPager and which have Tabbed Childs. The childs with recycler View do Scroll. Although When i create a simple fragment with scroll view it does not work. here is the main activity fragment - <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"

How to I achieve ViewPager (next/previous) in Music player App

时光总嘲笑我的痴心妄想 提交于 2020-02-20 04:53:43
问题 I want to know how I can achieve next and previous using swipe via a view pager. The final result I want is the one that Google Play Music has. I have uploaded a picture of what my app is behaving like and also what I expect. I basically cannot get my ViewPager to show me previews of the next and previous tracks. Can anyone please help me with how I can populate the view pager with pages of the tracks I want to play hence achieving that Google play music next/previous swipe in their music

How to update the content of view pager once it is initialized?

人盡茶涼 提交于 2020-02-08 07:20:51
问题 I have a view pager in the MainActivity , this view pager contains two tabs RecentFeed and SavedFeed both uses the same FeedFragment as both has same layout Now I want to update the contents of these fragments when a new gcm message is recieved or there occurs a change in my database here is what have done so far : I created a changelistening interface as follows- public interface OnDatabaseChangeListener { void onChange(); } Then used this in helper class to notify changes as follows private

How to update the content of view pager once it is initialized?

白昼怎懂夜的黑 提交于 2020-02-08 07:20:08
问题 I have a view pager in the MainActivity , this view pager contains two tabs RecentFeed and SavedFeed both uses the same FeedFragment as both has same layout Now I want to update the contents of these fragments when a new gcm message is recieved or there occurs a change in my database here is what have done so far : I created a changelistening interface as follows- public interface OnDatabaseChangeListener { void onChange(); } Then used this in helper class to notify changes as follows private

How to update the content of view pager once it is initialized?

不打扰是莪最后的温柔 提交于 2020-02-08 07:19:21
问题 I have a view pager in the MainActivity , this view pager contains two tabs RecentFeed and SavedFeed both uses the same FeedFragment as both has same layout Now I want to update the contents of these fragments when a new gcm message is recieved or there occurs a change in my database here is what have done so far : I created a changelistening interface as follows- public interface OnDatabaseChangeListener { void onChange(); } Then used this in helper class to notify changes as follows private

Scrollview not working when it has viewpager in android

人走茶凉 提交于 2020-02-06 09:07:07
问题 In my activity we have view pager which shows tabs and other views at top. ViewPager tabs shows different Fragments. Below is the code activity_main.xml <?xml version="1.0" encoding="utf-8"?> <androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/root" android:layout_width="match_parent" android:layout_height="match_parent" android:fillViewport="true"> <LinearLayout android:layout

ClasscastException when casting to ViewPager

☆樱花仙子☆ 提交于 2020-02-04 03:25:31
问题 I am trying to create an application based on the new ViewPager from the compability library. When I copy the lines from the sample application: setContentView(R.layout.main); MyAdapter mAdapter = new MyAdapter(getSupportFragmentManager(), this); ViewPager mPager = (ViewPager) findViewById(R.id.view_pager); mPager.setAdapter(mAdapter); with the following main.xml: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android

ClasscastException when casting to ViewPager

筅森魡賤 提交于 2020-02-04 03:25:09
问题 I am trying to create an application based on the new ViewPager from the compability library. When I copy the lines from the sample application: setContentView(R.layout.main); MyAdapter mAdapter = new MyAdapter(getSupportFragmentManager(), this); ViewPager mPager = (ViewPager) findViewById(R.id.view_pager); mPager.setAdapter(mAdapter); with the following main.xml: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android