viewpager

ClassNotFoundException when unmarshalling: android.support.v4.view.ViewPager$SavedState

匿名 (未验证) 提交于 2019-12-03 01:49:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am seeing the following error in my Android crash reports: android.os.BadParcelableException: ClassNotFoundException when unmarshalling: android.support.v4.view.ViewPager$SavedState at android.os.Parcel.readParcelable(Parcel.java:1971) at android.os.Parcel.readValue(Parcel.java:1859) at android.os.Parcel.readSparseArrayInternal(Parcel.java:2128) at android.os.Parcel.readSparseArray(Parcel.java:1581) at android.os.Parcel.readValue(Parcel.java:1916) at android.os.Parcel.readMapInternal(Parcel.java:2099) at android.os.Bundle.unparcel(Bundle

How to pass list <object> between fragment

匿名 (未验证) 提交于 2019-12-03 01:49:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've created my layout with viewPager and TabLayout: public class HomeFragment extends Fragment { public static TabLayout tabLayout; public static ViewPager viewPager; public static int int_items = 3 ; public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View inflatedView = inflater.inflate(R.layout.fragment_home, container,false); viewPager = (ViewPager) inflatedView.findViewById(R.id.viewpager); int [] drawables = {R.drawable.home,R.drawable.street,R.drawable.map}; Bundle bundle = new Bundle()

Error - No instrumentation registered! Must run under a registering instrumentation

匿名 (未验证) 提交于 2019-12-03 01:34:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: A) Why when i try to run the app i get this error? My Crash Log Error Unable to start activity ComponentInfojava.lang.IllegalStateException: No instrumentation registered! Must run under a registering instrumentation. What caused that? I'm yet learning and i'll appreciate if you can explain more. This is my code import android.app.ProgressDialog; import android.os.AsyncTask; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentPagerAdapter;

Android ViewPager and ListViews

匿名 (未验证) 提交于 2019-12-03 01:34:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm relatively new to Android development and development overall. I'm having trouble grasping the syntax/process for ViewPager. I have several ListViews that I want to implement into a ViewPager. I've got the compatibility pack loaded and everything. But I haven't seen any complete examples of how to do this. I learn best by looking at examples. If someone can post an examples of any projects you've implemented this sort of thing in, please let me know. The issue is that I get a Null Pointer Exception on this line when trying to launch my

Android ViewPager Screen Rotation

匿名 (未验证) 提交于 2019-12-03 01:33:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have an Activity with ActionBarSherlock tabs and a ViewPager inside it. When the pages are scrolled, the tabs are switched and tabs are changed, the current page is changed too. I am using a class that extends FragmentStatePagerAdapter as adapter in the pageview. The problem is that when the device rotates, the getItem from the page adapter is not called and looks like the fragments references are not right. That's a huge problem, since the user must fulfill some fields inside the pager. These fields are recovered in correctly on the

【Debug-singleLine】android:singleLine="true"已被废弃问题

穿精又带淫゛_ 提交于 2019-12-03 01:32:46
Bug描述 有一个界面,外层是ViewPager,内层嵌了一个RecyclerView。RecyclerView有自己的点击和滑动事件,造成外层的ViewPager无法左右滑动。 山重水复 尝试了很多方法,比如可能是外层的ViewPager和内层的RecyclerView有滑动冲突的问题。于是想方设法拦截其中的某项事件监听,但并无卵用。最后折腾半天无果,无奈,按照项目的写法逻辑重新实现了一遍,发现没有发生滑动冲突。 日了狗了。 感觉问题并不在于此。 柳暗花明 逐层查找,从ViewPager的Activity查找到ViewPager每个页面所显示的Fragment的编码,该Fragment的布局文件是一个RecyclerView,查一下该RecyclerView的适配器Adapter,码神保佑,我注意到了其中的【 onCreateViewHolder() 】找到其关联的布局文件,进去看一眼,好神奇,竟然是一个 TextView 。 问题解决 里面用到了一个属性 android:singleLine="true" 这个属性已被谷歌废弃,替换成 android:lines="1" android:ellipsize="end" 问题解决。 参考: https://blog.csdn.net/ldqsxsl/article/details/68485514 总结 1。在TextView中

how to get access of my button in one of my viewpager pages?

匿名 (未验证) 提交于 2019-12-03 01:22:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm new to this android and java. My viewpager now can slide all my xml layout, but i don't know how to access item in them. I tried using Button mybutton = (Button) findViewById (R.layout.result) , then set the onClickListener in mybutton, but then it was forced to close every time I run it. Here is my code: public class main extends Activity { private ViewPager myviewpager ; private ViewPagerAdapter myviewpageradapter ; private static int NUM_AWESOME_VIEWS = 12 ; Button button_1 ; @Override public void onCreate ( Bundle

tabMode=“scrollable” not working

匿名 (未验证) 提交于 2019-12-03 01:22:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am using the TabLayout from Android Design support library. I am using material design theme. Below is the code activity_scrollable_Tab.xml <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.design.widget.AppBarLayout <android.support.design.widget.TabLayout android:id="@+id/tabs" android:layout_width="match_parent" android:layout_height="wrap_content" app:tabMode="scrollable"/> </android

Replace current Fragment in ViewPager on Android

匿名 (未验证) 提交于 2019-12-03 01:20:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a ViewPager and I have to replace the first Fragment if a certain action happens. public static class PagerAdapter extends FragmentStatePagerAdapter{ private TempChannel latestChannel; private VideosFragment.SortType sortType; public PagerAdapter(FragmentManager fm) { super(fm); } @Override public Fragment getItem(int position) { switch (position){ case 0: if(latestChannel == null) { return new LatestVideosFragment(); }else{ return VideosFragment.getVideosFragment(latestChannel, sortType); } case 1: return new LiveVideosFragment();

Android Wear: WearableActivity with FragmentPagerAdapter

匿名 (未验证) 提交于 2019-12-03 01:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: When using the WearableActivity you can't reach getSupportFragmentManager() which FragmentPagerAdapter requires, so you need to use getFragmentManager() . Activity public MyWearActivity extends WearableActivity { public ArrayList<Fragment> mFragments; public ArrayList<String> mTitles; public ViewPager mViewPager; public PageFragmentPagerAdapter mPagerAdapter; @Override public void onCreate(Bundle b) { super.onCreate(b); setContentView(R.layout.main); fragments = new ArrayList<>(); mTitles = new ArrayList<>(); mViewPager = (ViewPager)