I'm running the app on two emulators that have exactly the same resolution but different densities:
I want the image to take the same space on the screen. I understand that, using DP, the density becomes indifferent, because the system calculates the amount of pixels according to the density and the space that the image must have on the screen. However, this does not happen:
HowdoIgetthisvalueinDPsothatanimagetakesexactlythesamespaceonscreenswithdifferentsizesanddensities?
XML:
<RelativeLayoutxmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/rl"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/logo"
android:layout_width="200dp"
android:layout_height="200dp"
android:src="@drawable/logo"
android:layout_centerInParent="true"/>
</RelativeLayout>