title: Android supporting different screen sizes error
body: <p>I am having an issue when it comes to supporting different screen sizes. Whatever I do the app always picks an xhdpi layout. I have tested on two smartphones. Samsung Core II and Huawei Y6.
  This is the dimension of both smartphones. </p>
  
  <pre><code>Samsung Core II Android 4.4
  480x800
  Screen density 1.5 which is hdpi
  
  Huawei y6 Android:9 
  720x1422 
  screen density 2.0 which is xhdpi
  </code></pre>
  
  <p>I have created two layout </p>
  
  <pre><code>mylayout.xml
        mylayout.xml (hdpi)
        mylayout.xml (xhdpi)
  </code></pre>
  
  <p>Now when I run the app on device xhdpi layout appears on both smartphones. How can I fix it? Here is XML for both layout</p>
  
  <p><strong>For hdpi</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:background="@color/lightgray"&gt;
  
      &lt;ImageView
          android:id="@+id/image_view_blur"
          android:layout_width="0dp"
          android:layout_height="100dp"
          android:background="@color/colorPrimary"
          android:contentDescription="@null"
          android:scaleType="fitXY"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintHorizontal_bias="0.0"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toTopOf="parent"
          app:layout_constraintVertical_bias="0.0"&gt;
  
  
      &lt;/ImageView&gt;
  
      &lt;TextView
          android:id="@+id/tv_nick_name"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_marginStart="16dp"
          android:layout_marginLeft="16dp"
          android:layout_marginTop="8dp"
          android:layout_marginEnd="16dp"
          android:layout_marginRight="16dp"
          android:textColor="@color/black"
          android:textSize="22sp"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintHorizontal_bias="0.53"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toBottomOf="@+id/iv_user_image" /&gt;
  
      &lt;spinkitview.SpinKitView
          android:id="@+id/iv_waiting"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_gravity="center_vertical|center_horizontal"
          android:layout_marginStart="8dp"
          android:layout_marginLeft="8dp"
          android:layout_marginEnd="8dp"
          android:layout_marginRight="8dp"
          android:visibility="invisible"
          app:SpinKit_Color="@color/colorPrimary"
          app:SpinKit_Style="MultiplePulse"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintHorizontal_bias="0.498"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toBottomOf="@+id/tv_nick_name" /&gt;
  
  
      &lt;TextView
          android:id="@+id/tv_no_internet"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_marginTop="8dp"
          android:background="@color/yellow"
          android:gravity="center"
          android:text="@string/no_internet"
          android:textColor="@color/black"
          android:textSize="16sp"
          android:visibility="invisible"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintHorizontal_bias="0.0"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toBottomOf="@+id/iv_conf_call" /&gt;
  
      &lt;ImageView
          android:id="@+id/iv_share"
          android:layout_width="wrap_content"
          android:layout_height="40dp"
          android:layout_marginTop="24dp"
          android:background="@drawable/ripple_with_background"
          android:contentDescription="@null"
          android:onClick="ivShare"
          android:padding="10dp"
          android:src="@drawable/ic_share"
          android:tint="@color/white"
          app:layout_constraintEnd_toStartOf="@+id/ic_contact_us"
          app:layout_constraintHorizontal_bias="0.5"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toBottomOf="@+id/tv_no_internet" /&gt;
  
  
      &lt;ImageView
          android:id="@+id/iv_conf_call"
          android:layout_width="45dp"
          android:layout_height="40dp"
          android:layout_marginStart="8dp"
          android:layout_marginLeft="8dp"
          android:layout_marginTop="8dp"
          android:layout_marginEnd="16dp"
          android:layout_marginRight="16dp"
          android:background="@drawable/ripple_with_background"
          android:contentDescription="@null"
          android:onClick="btnCall_Clicked"
          android:padding="10dp"
          android:src="@android:drawable/sym_action_call"
          android:tint="@color/white"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toBottomOf="@+id/iv_waiting" /&gt;
  
      &lt;ImageView
          android:id="@+id/ic_contact_us"
          android:layout_width="wrap_content"
          android:layout_height="40dp"
          android:background="@drawable/ripple_with_background"
          android:contentDescription="@null"
          android:onClick="ContactUs"
          android:padding="10dp"
          android:src="@drawable/ic_contact_us"
          android:tint="@color/white"
          app:layout_constraintBottom_toBottomOf="@+id/iv_share"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintHorizontal_bias="0.5"
          app:layout_constraintStart_toEndOf="@+id/iv_share"
          app:layout_constraintTop_toTopOf="@+id/iv_share"
          app:layout_constraintVertical_bias="0.0" /&gt;
  
  
      &lt;ImageView
          android:id="@+id/iv_user_image"
          android:layout_width="90dp"
          android:layout_height="90dp"
          android:layout_marginStart="8dp"
          android:layout_marginLeft="8dp"
          android:layout_marginEnd="8dp"
          android:layout_marginRight="8dp"
          android:background="@drawable/image_round_background"
          android:contentDescription="@null"
          android:padding="10dp"
          android:src="@drawable/unknown_image"
          android:tint="@color/colorPrimary"
          app:layout_constraintBottom_toBottomOf="@+id/image_view_blur"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toBottomOf="@+id/image_view_blur"
          app:layout_constraintVertical_bias="0.75" /&gt;
  &lt;/android.support.constraint.ConstraintLayout&gt;
  </code></pre>
  
  <p><strong>For xhdpi</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:background="@color/lightgray"&gt;
  
      &lt;ImageView
          android:id="@+id/image_view_blur"
          android:layout_width="0dp"
          android:layout_height="200dp"
          android:background="@color/colorPrimary"
          android:contentDescription="@null"
          android:scaleType="fitXY"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintHorizontal_bias="0.0"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toTopOf="parent"
          app:layout_constraintVertical_bias="0.0"&gt;
  
  
      &lt;/ImageView&gt;
  
      &lt;TextView
          android:id="@+id/tv_nick_name"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_marginStart="16dp"
          android:layout_marginLeft="16dp"
          android:layout_marginTop="8dp"
          android:layout_marginEnd="16dp"
          android:layout_marginRight="16dp"
          android:textColor="@color/black"
          android:textSize="22sp"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintHorizontal_bias="0.53"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toBottomOf="@+id/iv_user_image" /&gt;
  
      &lt;spinkitview.SpinKitView
          android:id="@+id/iv_waiting"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_gravity="center_vertical|center_horizontal"
          android:layout_marginStart="8dp"
          android:layout_marginLeft="8dp"
          android:layout_marginEnd="8dp"
          android:layout_marginRight="8dp"
          android:visibility="invisible"
          app:SpinKit_Color="@color/colorPrimary"
          app:SpinKit_Style="MultiplePulse"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintHorizontal_bias="0.498"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toBottomOf="@+id/tv_nick_name" /&gt;
  
  
      &lt;TextView
          android:id="@+id/tv_no_internet"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_marginTop="8dp"
          android:background="@color/yellow"
          android:gravity="center"
          android:text="@string/no_internet"
          android:textColor="@color/black"
          android:textSize="16sp"
          android:visibility="invisible"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintHorizontal_bias="0.0"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toBottomOf="@+id/iv_conf_call" /&gt;
  
      &lt;ImageView
          android:id="@+id/iv_share"
          android:layout_width="wrap_content"
          android:layout_height="80dp"
          android:layout_marginTop="24dp"
          android:background="@drawable/ripple_with_background"
          android:contentDescription="@null"
          android:onClick="ivShare"
          android:padding="10dp"
          android:src="@drawable/ic_share"
          android:tint="@color/white"
          app:layout_constraintEnd_toStartOf="@+id/ic_contact_us"
          app:layout_constraintHorizontal_bias="0.5"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toBottomOf="@+id/tv_no_internet" /&gt;
  
  
      &lt;ImageView
          android:id="@+id/iv_conf_call"
          android:layout_width="90dp"
          android:layout_height="90dp"
          android:layout_marginStart="8dp"
          android:layout_marginLeft="8dp"
          android:layout_marginTop="8dp"
          android:layout_marginEnd="16dp"
          android:layout_marginRight="16dp"
          android:background="@drawable/ripple_with_background"
          android:contentDescription="@null"
          android:onClick="btnCall_Clicked"
          android:padding="10dp"
          android:src="@android:drawable/sym_action_call"
          android:tint="@color/white"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toBottomOf="@+id/iv_waiting" /&gt;
  
      &lt;ImageView
          android:id="@+id/ic_contact_us"
          android:layout_width="wrap_content"
          android:layout_height="80dp"
          android:background="@drawable/ripple_with_background"
          android:contentDescription="@null"
          android:onClick="ContactUs"
          android:padding="10dp"
          android:src="@drawable/ic_contact_us"
          android:tint="@color/white"
          app:layout_constraintBottom_toBottomOf="@+id/iv_share"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintHorizontal_bias="0.5"
          app:layout_constraintStart_toEndOf="@+id/iv_share"
          app:layout_constraintTop_toTopOf="@+id/iv_share"
          app:layout_constraintVertical_bias="0.0" /&gt;
  
  
      &lt;ImageView
          android:id="@+id/iv_user_image"
          android:layout_width="180dp"
          android:layout_height="180dp"
          android:layout_marginStart="8dp"
          android:layout_marginLeft="8dp"
          android:layout_marginEnd="8dp"
          android:layout_marginRight="8dp"
          android:background="@drawable/image_round_background"
          android:contentDescription="@null"
          android:padding="10dp"
          android:src="@drawable/unknown_image"
          android:tint="@color/colorPrimary"
          app:layout_constraintBottom_toBottomOf="@+id/image_view_blur"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toBottomOf="@+id/image_view_blur"
          app:layout_constraintVertical_bias="0.75" /&gt;
  &lt;/android.support.constraint.ConstraintLayout&gt;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/gSUAv.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gSUAv.jpg" alt="xhdp Huawei"></a> <a href="https://i.stack.imgur.com/cpdgx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cpdgx.png" alt="hdpi samsung"></a></p>