I have two layouts - activity_main.xml and select.xml(transparent). In my MainActivity class I have:
setContentView(R.layout.activity_main);
and after that:
view = View.inflate(MainActivity.this, R.layout.select, null);
btnPrev = (ImageButton) view.findViewById(R.id.btnPrev);
btnNext = (ImageButton) view.findViewById(R.id.btnNext);
btnOk = (ImageButton) view.findViewById(R.id.btnOk);
btnPrev.setOnClickListener(this);
btnNext.setOnClickListener(this);
btnOk.setOnClickListener(this);
And the buttons appear but seem to do nothing. The onClick() method is fully implemented so I think there is something wrong in mixing the two layouts (select.xml is on top of activity_main.xml). Any advice?
Should be on top of this image(activity_main.xml):
When a menu item "select" is clicked.
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.whistle_change:
Intent a = new Intent(this, WhistleSelect.class);
startActivity(a);
break;
case R.id.exit:
break;
}
return false;
}