AndroidのWebViewにバックグラウンドリソースを設定しSplash画面のようなものを作っています。
コードは下記の通りです
[Activity]
mWebview = (WebView) findViewById(R.id.webview);
mWebview.setBackgroundResource(R.drawable.splash_screen);
[splash_screen.xml]
<?xml version="1.0" encoding="utf-8"?><layer-list xmlns:android="http://schemas.android.com/apk/res/android" android:opacity="opaque" android:layout_width="match_parent" android:layout_height="match_parent">
</layer-list><item android:drawable="@color/colorBack"/> <item> <bitmap android:gravity="center" android:src="@mipmap/ic_launcher" /> </item>
Android8.1で起動させると
android.content.res.Resources$NotFoundException: File res/drawable/splash_screen.xml from drawable resource ID #0x7f060067
のようなエラーが出てアプリが起動できません。
res/drawableにはsplash_screen.xmlが存在しているのですが・・・
何故、このようなエラーが起きるのでしょうか?
ご助言頂ければ幸いです。
あなたの回答
tips
プレビュー