I’m trying to make buttons clickable when the new layouts loads…
As what happens… I’m on the layout 1 and i have a few buttons shown…
When I press a button it will straight away show me a new layout with buttons from another .xml.
But it won’t let me click anything on layout 2.
How do i make it happen?
My code is below to go from layout 1 to layout R.layout.fail.
Button SectiontwoButton = (Button) findViewById(R.id.Sectiontwo);
SectiontwoButton.setOnClickListener(new OnClickListener() {
private Uri Uri;
@Override
public void onClick(View v) {
setContentView(R.layout.fail);
Uri uri=Uri;
Intent i=new Intent(Intent.ACTION_VIEW, uri);
mSoundManager.playSound(1);
}
});
Thanks
Wahid
You can put both your layouts as child of a viewflipper.
And instead calling setContentView again, you can use
This is the cleaner way of switching between layouts. This should also solve your click problem.