0
ボタンの背景リソースを変更するたびに、別のボタンが最初のボタンの外観を模倣するように、ボタンのバックグラウンドリソースを模倣するボタンの背景リソースを変更する方法を知りたいと思います。 。例えば他のボタンの背景リソースを模倣するボタンを設定する方法
:
int icon = R.drawable.ic_icon; //more specifically I stored R.drawable.ic_icon in SQL and retrieve and save in int icon when retrieve from that table, so when the table is change the first button dynamically change on create;
btn_01.setBackgroundResource(icon); //when this button is pressed it inflates a layout containing btn_02
btn_02.setBackgrounResource(??????); //this button is on a different layout and is used by different activity and should take the backgroundresource of the button that have been pressed to call that layout.
else文が、私は2番目のボタンでコピーする別のボタンがあり、各ボタンが異なるbackgroundresourceの可能性を持っている場合、私は使用することができます。私はここにとにかく完全にあなたの質問を理解したができなかった