目前,我正在开发一种使用感想器的仪器,问题是,我这样做的方式使开始和接收记忆的步伐极其缓慢。
I m 安装类似页数:
public MyPagerAdapter(Context context) {
views = new ArrayList<RelativeLayout>();
views.add(new SliderLayout(context, "slide 8"));
views.add(new SliderLayout(context, "slide 1"));
views.add(new SliderLayout(context, "slide 2"));
views.add(new SliderLayout(context, "slide 3"));
views.add(new SliderLayout(context, "slide 4"));
views.add(new SliderLayout(context, "slide 5"));
views.add(new SliderLayout(context, "slide 6"));
views.add(new SliderLayout(context, "slide 7"));
views.add(new SliderLayout(context, "slide 8"));
views.add(new SliderLayout(context, "Slide 1"));
}
All the layoutobjects contain a FrameLayout with a textView and a panel that contains a webview with local html. All the layouts have unique content, that is loaded and inflated when the SliderLayout class is instantiated.
我还试图就即时飞行的飞行补充看法。 项目方法,但这只是使滚动变得更有活力,如果我动得太快,就会给外派造成致命的例外。
So my question is, what is the best way to implement a ViewPager that contains several unique views (but based on the same layout), so it doesn t consume so much memory and starts quicker?