ボタンがクリックされたときに、タグを切り離してgmt_option_list_dst_off.xml
新しいレイアウトをタグに添付する必要があります。gmt_option_list_dst_on.xml
<include>
xml ファイルは次のとおりです。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:weightSum="6" >
<include
android:id="@+id/gmt_optionlist"
android:layout_weight="5"
layout="@layout/gmt_option_list_dst_off" />
<Button
android:id="@+id/dstbutton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="DST Off" >
</Button>
</LinearLayout>
実行時にタグを含めるために新しいレイアウトを添付することが可能であると私に提案してください。
私はいくつかの投稿を行ってきましたが、現在使用しています
parentOfAllInGMT.addView(layoutInflater.inflate(R.layout.gmt_option_list_dst_on, parentOfAllInGMT, true), 0);
しかし、これは正しくありません。