Android布局文件夹引起的问题

Android 运行到setContentView(R.layout.splash);

总是出现如下的错误: 

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.esri.localtiledlayer/com.login.SplashScreen}: android.view.InflateException: Binary XML file line #17: Error inflating class selector

测试机型是联想系列的平板。android版本是4.4.2

splash.xml放在layout-xlarge目录下,在其它10.1英寸1920*1200的平板运行没问题。

但运行在13.3英寸2560*1440的平板却总是报这个错。

经过不断测试,最终发现问题出在布局文件所放置的文件夹上。

将splash.xml移到layout-land目录下,两种平板就都可以顺利运行。

原文地址:https://www.cnblogs.com/janehlp/p/4601887.html