I would like to update an xml file from another xml file.I have used an xml file as shown below:
one.xml
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" android:background="#00BFFF">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="fill_parent"
android:layout_height="wrap_content" android:gravity="center" android:visibility="visible">
</LinearLayout>
<LinearLayout
android:id="@+id/linearLayout2"
android:layout_width="fill_parent"
android:layout_height="wrap_content" android:gravity="center" android:visibility="visible">
</LinearLayout>
</LinearLayout>
</ScrollView>
two.xml as follows:
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<map>
<int name="linearLayout1" value="8" />
<int name="linearLayout2" value="0" />
</map>
from the above two xml files i would like to change the attribute value one. xml when if
<int name ="linearLayout1" value = "8"/>
from two.xml then I would like to update one.xml file as where LinearLayout android:id="@+id/linearLayout1" then change the attribute value as android:visibility="gone".