I am beginner in android and was wondering what the difference is between the
tools:context
and android:name
attributes?
1. android:name=".fragments.DataFragment"
2. tools:context=".activities.MainActivity"
The full code:
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/fragment"
android:name=".fragments.DataFragment"
tools:layout="@layout/data_fragment"/>
<LinearLayout 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=".activities.MainActivity"
/>