报错信息:

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. 滑动窗口协议(Sliding Window Protocol)

    滑动窗口协议(Sliding Window Protocol),属于TCP协议的一种应用,用于网络数据传输时的流量控制,以避免拥塞的发生.该协议允许发送方在停止并等待确认前发送多个数据分组.由于发送方 ...

  2. 《ucore lab1 exercise3》实验报告

    资源 ucore在线实验指导书 我的ucore实验代码 题目:分析bootloader进入保护模式的过程 BIOS将通过读取硬盘主引导扇区到内存,并转跳到对应内存中的位置执行bootloader.请分 ...

  3. Xamarin.Forms FlyoutIcon 不显示(not shown)

    升级了VS2019到16.4版本,然后默认创建了一个Xamarin Shell程序 结果运行后是这个样子 难道不应该是这个样子吗? 百了个度一晚上没解决,资料本身就少,再就是提示设置FlyoutIco ...

  4. 【LOJ】#2720. 「NOI2018」你的名字

    题解 把S串建一个后缀自动机 用一个可持久化权值线段树维护每个节点的right集合是哪些节点 求本质不同的子串我们就是要求T串中以每个点为结束点的串有多少在\(S[l..r]\)中出现过 首先我们需要 ...

  5. 【牛客网】Idol Master

    [牛客网]Idol Master 也是一道网络流解线性规划 不过需要从小于号的那边解 限制是\(a \leq \sum_{i = 1}^{k} x_{i}\leq b\) 其中\(0 \leq x_{ ...

  6. 【JVM基础】JVM垃圾回收机制算法

  7. 变量————if语句——结构使用

    1简述变量的命名规范 变量是以字母 数字 下划线组合而成 不能以数字开头 不能使用python中的关键字命名 变量要具有可描述性 区分大小写 name变量是什么数据类型通过代码检测 name = in ...

  8. yii2 migrate 数据库迁移的简单分享

    开发中经常会用到的方法小结: 1../yii migrate xxx_xx 在表中插入某字段 : public function up() {$this->addColumn('{{applic ...

  9. S03_CH09_DMA_4_Video_Switch视频切换系统

    S03_CH09_DMA_4_Video_Switch视频切换系统 9.1概述 本例程详细创建过程和本季课程第一课<S03_CH01_AXI_DMA_LOOP 环路测试>非常类似,因此如果 ...

  10. 【规律】Farey Sums

    [参考博客]: https://blog.csdn.net/meopass/article/details/82952087 Farey Sums 题目描述 Given a positive inte ...