我已将eclipse项目移至Android工作室。并在Gradle中使用了一些eclipse jar文件。 对于导航,它使用Blur Navigation Drawer和基于它的应用程序。问题是在新的android工作室项目中从下一行开始出错。
android.view.InflateException: Binary XML file line #2: Binary XML file line #2: Error inflating class com.charbgr.BlurNavigationDrawer.v7.BlurDrawerLayout
因为即时通讯新手我还不明白它背后的原因是什么。 我已经花了3天多的时间。现在真的在寻求帮助。
活动类: -
private NavigationDrawerFragment mNavigationDrawerFragment;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.navigation_drawer_main_activity);
Fragment fragment = new CalendarMainActivity();
FragmentManager fragmentManager = getSupportFragmentManager();
fragmentManager.beginTransaction().replace(R.id.container, fragment)
.commit();
mNavigationDrawerFragment = (NavigationDrawerFragment) getSupportFragmentManager()
.findFragmentById(R.id.navigation_drawer);
// Set up the drawer.
mNavigationDrawerFragment.setUp(R.id.navigation_drawer,
(DrawerLayout) findViewById(R.id.drawer_layout));
restoreActionBar();
}
布局: -
<!-- A DrawerLayout is intended to be used as the top-level content view using match_parent for both width and height to consume the full space available. -->
<com.charbgr.BlurNavigationDrawer.v7.BlurDrawerLayout
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:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:blurRadius="19"
app:closeDescription="@string/navigation_drawer_close"
app:downScaleFactor="0.0"
app:drawerUpImageId="@drawable/ic_menu"
app:openDescription="@string/navigation_drawer_open"
tools:context=".NavigationDrawerFragmentMainActivity">
Gradle文件: -
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:24.0.0'
testCompile 'junit:junit:4.12'
compile 'com.googlecode.android-query:android-query:0.25.9'
compile 'com.j256.ormlite:ormlite-android:4.45'
compile 'com.joanzapata.pdfview:android-pdfview:1.0.4@aar'
compile 'com.loopj.android:android-async-http:1.4.4'
compile files('libs/main.jar') // This contains the Blur Navigation
compile files('libs/library.jar')
compile files('libs/date4j.jar')
}