レイアウトでボタンをクリックすると、res / drawable内のすべてのドローアブルのリストが表示されます。そのうちの1つをクリックすると、同じレイアウトを表示する必要があります。質問は、ユーザーが以前にクリックしたボタンにアクセスする方法です。
public void onItemClick(AdapterView<?> arg0, View arg1,
int arg2, long arg3) {
setContentView(layoutIds[position]);
Button button=allButtonsInLayout.get(arg2);
button.setBackgroundResource(R.drawable.images_sos);
}
次の場合、背景を変更できます。
Button button=(Button)findViewById(R.id.button);
しかし、その行をに変更しても何も起こりません
Button button=allButtonsInLayout.get(arg2);