首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在启动时崩溃

在启动时崩溃
EN

Stack Overflow用户
提问于 2015-11-09 02:23:56
回答 2查看 81关注 0票数 1

该应用程序在启动后立即崩溃,并出现错误:

代码语言:javascript
复制
11-08 21:13:08.704 15973-15973/com.t99sdevelopment.centralized E/AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.t99sdevelopment.centralized/com.t99sdevelopment.centralized.HomeScreen}: android.view.InflateException: Binary XML file line #81: Error inflating class android.support.design.widget.NavigationView

java文件:

代码语言:javascript
复制
package com.t99sdevelopment.centralized;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Window;
import android.widget.Toolbar;



public class HomeScreen extends AppCompatActivity {



   Intent intentHome = new Intent(this, HomeScreen.class);
   Intent intentAnnouncements = new Intent(this, AnnouncementsScreen.class);
   /*
   Intent intentSchedule = new Intent(this, ScheduleScreen.class);
   Intent intentCalendar = new Intent(this, CalendarScreen.class);
   Intent intentContactBook = new Intent(this, ContactBookScreen.class);
   Intent intentSportsSchedule = new Intent(this, SportsScheduleScreen.class);
   Intent intentFrontAndCentral = new Intent(this, FrontAndCentralScreen.class);
   Intent intentMap = new Intent(this, MapScreen.class);
   Intent intentAccount = new Intent(this, AccountScreen.class);
   */



   @Override
   protected void onCreate(Bundle savedInstanceState) {
       super.onCreate(savedInstanceState);
       setContentView(R.layout.activity_homescreen);
       setTheme(R.style.AppTheme);
   }



   private void goToHome(){



   }
   private void goToAnnouncements(){
       startActivity(intentAnnouncements);
   }



   private void goToSchedule(){



   }



   private void goToCalendar(){



   }



   private void goToContactBook(){



   }



   private void goToSportsSchedule(){



   }



   private void goToFrontAndCentral(){



   }



   private void goToMap(){



   }



   private void goToAccount(){



   }
}

这是其他文件的要点。

这个错误表示导航抽屉无法创建,但是从上次导航抽屉工作到现在,我没有改变任何看起来会影响它的东西。

我查看了代码,更改了一些内容,错误保持不变,但是代码不同,所以我提交了一个不同的新页面这里,解决了这个问题。

EN

回答 2

Stack Overflow用户

发布于 2015-11-09 06:39:21

如果你真的什么都没做,试着清除和构建项目,或者把代码复制到新的项目中。

票数 0
EN

Stack Overflow用户

发布于 2015-11-09 06:41:48

设计库和Proguard的23.1.0版本有一个问题。作为解决办法,您应该添加

代码语言:javascript
复制
-keep class android.support.v7.widget.LinearLayoutManager { *; } 

敬你的卫兵规则。

看一下这个问题:NavigationView InflateException

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/33601566

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档