मैंने android data binding पढ़ा है और इसे अपने एप्लिकेशन, में उपयोग करना चाहता हूं लेकिन मैं एक्सएमएल लेआउट चरण में विफल रहा।टैबहोस्ट लेआउट और डेटा बाइंडिंग
मैं activity_main.xml
इस तरह है:
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<data>
</data>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TabWidget
android:id="@android:id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/tab1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include layout="@layout/tab1"/>
</LinearLayout>
</FrameLayout>
</LinearLayout>
</TabHost>
</layout>
और tab1.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
<EditText
...
मैं पिछले EditText
के लिए बाध्य डेटा लागू करना चाहते हैं, लेकिन मैं
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<data>
</data>
<TabHost>
...
सम्मिलित करता है, तो यह
का कारण बनता हैactivity_main.xml:9: AAPT: Error parsing XML: duplicate attribute
सवाल यह है कि, मैं डेटा बाध्यकारी और TabHost
को EditText
को शामिल लेआउट में बाध्य करने के लिए कैसे जोड़ूं?
Here is repo with code from question
आपने अपने किसी भी टैग को क्यों बंद नहीं किया है? – Codebender
हमें पूर्ण xml – Salman500
@ सलमान 500 दिखाएं, आप सवाल से xml पा सकते हैं https://github.com/davemilter/TabHostDataBinding/tree/master/app/src/main/res/layout – user1244932