activity android:logo,启动应用显示LOGO再跳转页面出现有关问题

启动应用显示LOGO再跳转页面出现问题

新人刚接触安卓,做了个功能有异常 求大神指点

启动应用首先会显示图片 然后再跳转页面,出现异常,上异常和代码

SplashActivity 类

private final int SPLASH_DISPLAY_LENGHT = 3000; //延迟三秒

@Override

public void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

//去掉应用标题

//requestWindowFeature(Window.FEATURE_NO_TITLE);

setContentView(R.layout.splash);

new Handler().postDelayed(new Runnable(){

@Override

public void run() {

Intent mainIntent = new Intent(SplashActivity.this,MainActivity.class);

SplashActivity.this.startActivity(mainIntent);

SplashActivity.this.finish();

}

}, SPLASH_DISPLAY_LENGHT);

}

splash.xml

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:orientation="vertical" >

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:scaleType="matrix"

android:src="@drawable/splash" />

跳转到MainActivity类 (默认生成的Activity类)

@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

//去掉应用标题

//requestWindowFeature(Window.FEATURE_NO_TITLE);

setContentView(R.layout.activity_main);

if (savedInstanceState == null) {

getSupportFragmentManager().beginTransaction()

.add(R.id.container, new PlaceholderFragment()).commit();

}

}

异常

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.yn.pindiao/com.yn.pindiao.demo.SplashActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class linearlayout

------解决思路----------------------

没有linearlayout

只有LinearLayout,大小写区分

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值