I am a self learner of android and I am trying to make an app that displays message as Toast.I made the app on Android Studio and it seems okay but when I run it on my phone which runs on Android 5.0 ,all the widgets are overlapped while in studio all of it looks fine.Please Help. This is how it looks on phone:
This is how it looks on Android
<?xml version="1.0" encoding="utf-8"?>
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.rahulranjan.toast1.MainToast">
<Button
android:id="@+id/test1"
android:layout_width="368dp"
android:layout_height="wrap_content"
android:onClick="btnClick"
android:text="Click Me"
android:textColor="#00C957"
tools:layout_editor_absoluteY="130dp"
tools:layout_editor_absoluteX="8dp" />
<TextView
android:id="@+id/textView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="Click Below to see Toast :"
tools:layout_editor_absoluteY="40dp"
tools:layout_editor_absoluteX="112dp"
android:textColor="#E3CF57"
/>
And yeah I have used ConstrainLayout,I don't know why its not displaying here on this site. Thanks