XML 中將 <Button> 改為 <ImageButton>,運行崩潰:ClassCastException: Button cannot be cast to ImageButton。
Java 代碼仍用 Button btn = findViewById(R.id.xxx),而實際視圖已為 ImageButton,類型不匹配。
// 修改前
Button btn = findViewById(R.id.my_button);
// 修改後
ImageButton btn = findViewById(R.id.my_button);
// 或統一用 View/父類
View btn = findViewById(R.id.my_button);
btnSubmit、ibAvatar、tvTitle,前綴暗示類型。