I created a simple application and set the Background of LinearLayout to the image. when i run it, don't show the background image. I see this log line:
W/PackageManager﹕ Failure retrieving resources for vania.backgroundtest: Resource ID
Why is it impossible to display a background image? This is my layout code:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="match_parent" android:layout_width="match_parent" android:background="@drawable/backimage" > </LinearLayout>
This is my Java code:
public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } }
and this is obvious:
<application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name=".MainActivity" android:label="@string/app_name" android:screenOrientation="landscape" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application>
I used the .jpg image from 1920 * 1080 (412 KB)
source share