This is the code of my activity.xml here I used two relative layout but it is not accepting the id's of the txt views within which is why i am not able to use them in my java code. I don't know what the problem is.
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/background"
xmlns:android="http://schemas.android.com/apk/res/android">
<com.example.gproject.GameView
android:id="@+id/gv"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<TextView
android:visibility="invisible"
android:id="@+id/txt_score"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#002247"
android:textSize="50sp"
android:text="0"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"/>
<Button
android:id="@+id/btn_start"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Start"
android:padding="5dp"
android:layout_centerInParent="true"
android:background="#ffffff"
android:textColor="#000000"
/>
<RelativeLayout
android:id="@+id/r1_game_over"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="invisible">
<TextView
android:id="@+id/txt_game_over"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Game Over"
android:textSize="50sp"
android:layout_centerInParent="true"
android:textColor="#ff00"/>
</RelativeLayout>
</RelativeLayout>