java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ex.activity/com.ex.activity.LoginActivity}: android.view.InflateException: Bina

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
时间: 2024-09-19 09:07:59

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ex.activity/com.ex.activity.LoginActivity}: android.view.InflateException: Bina的相关文章

Android中调用startActivity结果导致:java.lang.RuntimeException: Unable to start activity ComponentInfo{xxx}

Android中调用startActivity结果导致:上网查了一下,总结如下: 第一种情况:java.lang.RuntimeException: Unable to start activity ComponentInfo{xxx}: java.lang.NullPointerException 错误代码: private int defaultDrawable=R.drawable.radio; private String defaultTitle=getString(R.string.

安卓开发闪退-安卓开发中java.lang.RuntimeException: Unable to start activity ComponentInfo问题

问题描述 安卓开发中java.lang.RuntimeException: Unable to start activity ComponentInfo问题 package com.example.test; import android.app.ActivityGroup;import android.app.LocalActivityManager;import android.content.Intent;import android.os.Bundle;import android.vi

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

错误信息字符串:Java.lang.RuntimeException: Unable to start activity ComponentInfo{com.first/com.first.Game}: java.lang.NullPointerException 一般都会在Activity  onCreate()方法里的setContentView(XXX)发生此错误,网上查阅了很多原因,大概有四种重要可能的原因: 原因一:xxx的错误,若为R.layout.main  那么应该是main.x

类型转换异常处理java.lang.RuntimeException

前几天在做一个安卓项目的时候一直报java.lang.RuntimeException错,一直调试不出来,今天突然又灵感是不是文件配置出错了,果然在清单文件中少了一句 android:name=".KXApplication". 02-05 10:19:52.429: E/AndroidRuntime(16026): java.lang.RuntimeException: Unable to start activity ComponentInfo{cn.tianfang1314.c/

WebService CXF版本频繁调用时,出现java.lang.RuntimeException: org.apache.c

问题描述 java.lang.RuntimeException:org.apache.cxf.interceptor.Fault:异常org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:102)org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInter

FAILED: Hive Internal Error: java.lang.RuntimeException(Error while making MR scratch directory异常的解决

hive> select * from dummy; FAILED: Hive Internal Error: java.lang.RuntimeException(Error while making MR scratch directory - check filesystem config (null)) java.lang.RuntimeException: Error while making MR scratch directory - check filesystem config

nutch Exception in thread "main" java.lang.RuntimeException: job failed: name=ge

问题描述 stone@stone-virtual-machine:~/apache-nutch-2.2.1/runtime/local$bin/nutchcrawlurls/seed.txt-dircrawl-depth3-topN5InjectorJob:Usingclassorg.apache.gora.memory.store.MemStoreastheGorastorageclass.InjectorJob:totalnumberofurlsrejectedbyfilters:0Inje

我的Android进阶之旅------>Android中MediaRecorder.stop()报错 java.lang.RuntimeException: stop failed.

今天在调用MediaRecorder.stop(),报错了,java.lang.RuntimeException: stop failed. E/AndroidRuntime(7698): Cause by: java.lang.RuntimeException: stop failed. E/AndroidRuntime(7698): at android.media.MediaRecorder.stop(Native Method) E/AndroidRuntime(7698): at co

nutch 2.2.1 运行报错InjectorJob: java.lang.RuntimeException: job failed: name=inject

问题描述 在windows下的eclipse中运行报错,如下,求各位大神帮帮忙,本人小白一个,急急急急InjectorJob:startingat2014-06-2615:45:36InjectorJob:InjectingurlDir:urlsInjectorJob:Usingclassorg.apache.gora.memory.store.MemStoreastheGorastorageclass.****file:/D:/workspace/nutchTest/urlsInjectorJ