Here is my Code:
ImageButton ibtnCherry;
ImageButton ibtnSelected;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.setup);
ibtnCherry = (ImageButton)findViewById(R.id.ibtnCherry);
ibtnCherry.setOnClickListener(this);
}
onClick:
@Override
public void onClick(View view) {
ibtnSelected = ??????????;
Intent sdintent = new Intent(Intent.ACTION_PICK);
sdintent.setType("image/*");
sdintent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(sdintent, GlobaleVariablen.SD_REQUEST);
}
My Problem is, that I need something like "ibtnSelected = ibtnCherry" in the row with the questionmarks, but dynamically, so when another button (e.g. ibtnTmp) fires the same onClick event, ibtnTmp is saved in ibtnSelected.
Is there any chance to get the element in the onClick event that fires it?