0
假設我有一個TextView
,我指定它在XML ID這樣如果視圖ID在android中動態更改會發生什麼?
<TextView
android:id="@+id/myTextViewId"
android:layout_width="190dp"
android:layout_height="48dp"
android:layout_marginLeft="60dp"/>
現在我正在TextView
參考,並更改像這樣的參考。
TextView myTextView =findViewById(R.id.myTextViewId);
myTextView.setId(50);
現在我的問題是,如果我想使用此myTextViewId
ID的另一個活動的TextView會發生什麼? id變化是否影響已經在xml中定義的原始視圖ID。