报错信息:

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.pro_u_loc/com.example.pro_u_loc.signActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.

报错截图:

真机调试结果:

点击按钮自动弹出软件并报错日志。

错误原因:

login_activity中,一个按钮的id使用了main_activity中的id

修改:

将login_activity中的按钮换为它自己的id:

Button sign1 = findViewById(R.id.zhuce);

因为Android studio很多时候按钮功能非常相似,你点击的时候出现的.id不止当前页面的按钮id,所有界面的id都出现啦,很有可能不留神就点错误了。

如何查看自己错误原因:
我在手机上调试的时候,手机日志有一行:
loginacticity (48),在我所知道.java文件中,48行出现问题。所以就找到问题原因了。
 

android studio调试报错:java.lang.RuntimeException: Unable to start activity ComponentInfo的更多相关文章

  1. java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ex.activity/com.ex.activity.LoginActivity}: android.view.InflateException: Binary XML file line #1: Error inflating class

    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ex.activity/com.ex.activity.L ...

  2. Android开发中java.lang.RuntimeException: Unable to start activity ComponentInfo{xxx}

    Android开发中java.lang.RuntimeException: Unable to start activity ComponentInfo{xxx}: java.lang.NullPoi ...

  3. java.lang.RuntimeException: Unable to instantiate activity ComponentInfo异常总结

    java.lang.RuntimeException: Unable to instantiate activity ComponentInfo异常总结 做android开发的可能都碰到"j ...

  4. java.lang.RuntimeException: Unable to start activity ComponentInfo

    异常:java.lang.RuntimeException: Unable to start activity ComponentInfo{com.william/com.william.Result ...

  5. 转载java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.spinner/com.example.spinner.MainActivity}: java.lang.NullPointerException

    今天学习Android开发突然遇到了这个问题,查阅了很多资料,并且对集中原因进行了分析. 错误信息字符串:java.lang.RuntimeException: Unable to start act ...

  6. java.lang.RuntimeException: Unable to start activity ComponentInfo……AppCompat does not support the current theme features

    Android测试时出现闪退的问题,出现了如下所示异常: java.lang.RuntimeException: Unable to start activity ComponentInfo{thon ...

  7. Java.lang.RuntimeException: Unable to instantiate activity ComponentInfo

    如果你更新了ADT的新版本,而工程文件中使用了其他的jar包,也可能会出现"java.lang.RuntimeException: Unable to instantiate activit ...

  8. hive 报错 java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.metastore.HiveMetaStoreClient

    Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Unable ...

  9. java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.love5/com.example.love5.Main11Activity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.

    若有 java.lang.RuntimeException和 java.lang.NullPointerException: Attempt to invoke virtual method 'voi ...

随机推荐

  1. 2、2 唯一验证,这里我们强调后台的唯一验证&在保存之前进行验证

    后台 —————————————————————————————————————————————— @RequestMapping("/uniqueNameCheck") publ ...

  2. Win7 JavaEE 安装

    新建四个目录 D:\ApacheServer\eclipse 存放eclipse D:\ApacheServer\jdk jdk安装目录 D:\ApacheServer\apache-tomcat 存 ...

  3. (十)EL表达式和JSTL标签快速入门

    目录 什么是 el 表达式 示例:使用EL表达式获取pageContext .request.session.application域中的数据: 示例:使用EL表达式获取Bean属性 获取当前WEB应 ...

  4. 基于聚类K-Means方法实现图像分割

    ”“”K-Means to realize Image segmentation “”“ import numpy as np import PIL.Image as image from sklea ...

  5. GBK字符集

    GBK字库 编辑 同义词 GBK一般指GBK字库 GBK全称<汉字内码扩展规范>(GBK即“国标”.“扩展”汉语拼音的第一个字母,英文名称:Chinese Internal Code Sp ...

  6. 利用Python进行数据分析_Numpy_基础_2

      Numpy数据类型包括: int8.uint8.int16.uint16.int32.uint32.int64.uint64.float16.float32.float64.float128.co ...

  7. Linux (x86) Exploit 开发系列教程之一(典型的基于堆栈的缓冲区溢出)

    (1)漏洞代码 //vuln.c #include <stdio.h> #include <string.h> int main(int argc, char* argv[]) ...

  8. Java InsertionSort

    Java InsertionSort /** * <html> * <body> * <P> Copyright 1994-2018 JasonInternatio ...

  9. C#多线程的简单理解

    一.CLR线程池基础 创建和销毁线程是一个昂贵的操作,所以CLR管理了一个线程池(thread pool),可以将线程池看成一个黑盒. CLR初始化时,线程池中是没有线程的.线程的初始化与其他线程一样 ...

  10. 前端开发 Vue -1windows环境搭建Vue Node开发环境

    解决几个疑问: 想学习下vue.js,我理解的它是一个前端的框架,主要作用是对数据的处理,和juqery类似,所以不太理解为什么要在nodejs中npm install vue呢?在html文件中引入 ...