Hi all, this is probably a newbie question. but i'...
# getting-started
k
Hi all, this is probably a newbie question. but i'm curious to know, whether in kotlin you can call components from other file into main file. i've tried to research about this before, but i can't find any resources that explaining about this stuff. here is the example of what i mean: main.xml
Copy code
<LinearLayout
   android:id="@+id/linear_main"
   xmlns:android="<http://schemas.android.com/apk/res/android>"
   xmlns:tools="<http://schemas.android.com/tools>"
   xmlns:app="<http://schemas.android.com/apk/res-auto>"
   android:layout_width="match_parent"
   android:layout_height="match_parent"
   android:orientation="horizontal"
   >

   <TextView
			android:layout_width="match_parent"
			android:layout_height="wrap_content"
			android:text="Hello World"
			android:textColor="@color/Black01"
			/>

  /*insert some kind of tag in here to call the id of new_image element from second_file.xml*/


</LinearLayout>
second_file.xml
Copy code
<LinearLayout
   android:id="@+id/linear_second"
   xmlns:android="<http://schemas.android.com/apk/res/android>"
   xmlns:tools="<http://schemas.android.com/tools>"
   xmlns:app="<http://schemas.android.com/apk/res-auto>"
   android:layout_width="match_parent"
   android:layout_height="match_parent"
   android:orientation="horizontal"
   >

   <ImageView
            android:id="@+id/new_image"
			android:layout_width="wrap_content"
			android:layout_height="wrap_content"
            app:srcCompat="@drawable/button_image"
			/>

</LinearLayout>
do note that the attached code in here is just an simple example code. as i would like to know, if it's possible or not to call only id of textview/imageview from the other xml file, into the main file.
m
probably better asked #android
k
ok, thanks for the advice