[ad_1]
I have three files: MainActivity.java, MapsActivity.java and MainActivity.xml. I would like to change this TextView object in the MainActivity.xml:
<TextView
android:id="@+id/destination_latlng"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="80dp"
android:layout_marginBottom="40dp"
android:textColor="@color/black"
android:text="Destination Lat, Lng" />
I would like to change it from within the MapsActivity.java file, but whenever I try to do this by assigning a variable to the “destination_latlng” TextView and using setText() the app crashes. How do I change the TextView from the MapsActivity.java file?
[ad_2]