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

  

异常解决方案:

是因为设置background的图片太大了,造成了内存溢出,在Activity设置onCreate里面加载布局的时候出错

不要设置跟布局的background为图片,可以用FrameLayout和ImageView实现相同的效果。

Option 1:

Create different perfect images for different dpi and place them in related drawable folder. Then set

android:background="@drawable/your_image

Option 2:

Add a single large image. Use FrameLayout. As a first child add an ImageView. Set the following in your ImageView.

android:src="@drawable/your_image"
android:scaleType = "centerCrop" 参考噢:http://stackoverflow.com/questions/16135984/full-screen-background-image-in-an-activity

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的更多相关文章

  1. java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.paipaixiu/com.example.paipaixiu.MASetSomeThing}: android.view.InflateException: Binary XML file line #19: Attempt to invo

    这个报错是因为Android布局的控件 <view android:layout_width="match_parent" android:layout_height=&qu ...

  2. Unable to start activity ComponentInfo{com.example.administrator.myapplication/com.example.administrator.myapplication.MainActivity}: android.view.InflateException: Binary XML file line #0: Binary XM

    本来就是把fragment写死在activity的xml模板里面,结果报了这个错误, Unable to start activity ComponentInfo{com.example.admini ...

  3. E/AndroidRuntime(1636): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.***.app.wx.MainActivity} : android.view.InflateException: Binary XML file line #51 :

    类中加载的xml中,所自定义组件的包名错误(xml中51行错误:自定义组件包名写错了).

  4. 转载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 ...

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

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

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

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

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

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

  8. 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 ...

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

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

随机推荐

  1. python中发送get或post请求

    示例 get import httplib import uuid import time url = "/KM/test.php?time=" url += str(int(ti ...

  2. HTML5简单入门系列(四)

    前言 今天这篇内容主要讲述HTML 5 Web Worker(一种支持前端js多线程的技术). 工作线程(Web Worker) web worker介绍 W3C 在 HTML5 的规范中提出了工作线 ...

  3. 正确看待HTML5的语法变化

    也许会有人问:“HTML4已经很普及了,如果改变基础语法,会不会有什么影响?” 我们都知道,在HMTL5之前几乎没有符合标准规范的Webu浏览器!在这种情况下,各个浏览器之间的互相兼容性和互操作性在很 ...

  4. 【其他】IT公司的企业文化与竞争力

    一直觉得三流企业靠成本竞争,二流企业靠体制竞争,一流企业靠文化竞争. 企业在竞争时候,总会提到一个词:核心竞争力.对于IT企业来说,核心竞争是什么?无论是技术也好,销售也罢,归根到底还是人才的竞争,优 ...

  5. QThread与其他线程间相互通信

    转载请注明链接与作者huihui1988 QThread的用法其实比较简单,只需要派生一个QThread的子类,实现其中的run虚函数就大功告成, 用的时候创建该类的实例,调用它的start方法即可. ...

  6. 认识元数据和IL(下)<第五篇>

    书接上回: 第二十四回:认识元数据和IL(上) , 第二十五回:认识元数据和IL(中) 我们继续. 终于到了,说说元数据和IL在JIT编译时的角色了,虽然两个回合的铺垫未免铺张,但是却丝毫不为过,因为 ...

  7. 分治法求一个N个元素数组的逆序数

    背景  逆序数:也就是说,对于n个不同的元素,先规定各元素之间有一个标准次序(例如n个 不同的自然数,可规定从小到大为标准次序),于是在这n个元素的任一排列中,当某两个元素的先后次序与标准次序不同时, ...

  8. 格而知之3:Core Data的基本使用

    最近准备做一个随手笔记类的app给自己用,考虑到从未使用过Core Data,就决定用Core Data来做数据存储.在网上参考了一些Core Data的资料后,用一天的时间写了这个demo,主要测试 ...

  9. 求高精度幂(java)

    求高精度幂 时间限制:3000 ms  |  内存限制:65535 KB 难度:2   描述 对数值很大.精度很高的数进行高精度计算是一类十分常见的问题.比如,对国债进行计算就是属于这类问题. 现在要 ...

  10. Han Move(细节题)

    Problem 1609 - Han Move Time Limit: 1000MS   Memory Limit: 65536KB    Total Submit: 620  Accepted: 1 ...