Kitkat not picking up android:background from Layout XML file, Jelly is OK
-
23-12-2019 - |
Question
The same XML looks different in Android 4.3 vs 4.4. Problem is that Kitkat (4.4) is not picking up this line: "android:background="@drawable/darkgray"
(darkgray.jpg is an img)
Why Kitkat is behaving differently?
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res/com.mavdev.focusoutfacebook"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/darkgray"
android:orientation="vertical" >
<TextView
android:id="@+id/tv_secs2"
android:layout_width="100dp"
android:layout_height="wrap_content"
/>
</RelativeLayout>
The difference is as below:
Solution
It might because your 4.4 phone has different DPIs. Please double confirm it.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow