android.support.v4.view.ViewPager无法转换为android.support.v4.view.ViewPager [英] android.support.v4.view.ViewPager cannot be cast to android.support.v4.view.ViewPager
本文介绍了android.support.v4.view.ViewPager无法转换为android.support.v4.view.ViewPager的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是我的xml代码:
<android.support.v4.view.ViewPager
android:id="@+id/guide_pager"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
.................
这是我的android java代码.
and this is my android java code.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.guide);
// here will be crash
mPager = (ViewPager) findViewById(R.id.guide_pager);
}
在代码中,
会抛出一个执行:android.support.v4.view.ViewPager无法转换为android.support.v4.view.ViewPager.但我的项目中只有一个support.v4.jar.谁可以帮助我?
in the code, there well be throw an execption:android.support.v4.view.ViewPager cannot be cast to android.support.v4.view.ViewPager. but only one support.v4.jar in my project. who can help me?
推荐答案
这样做...
1) Remove the `android-support-v4.jar` from your project
2) clean the project
3) copy the jar file from `yourdrive:\android-sdks\extras\android\support\v4`
4) add this library to your project
这篇关于android.support.v4.view.ViewPager无法转换为android.support.v4.view.ViewPager的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文