btn.setOnClickListener(new OnClickListener()
{
public void onClick(View v) {
Intent i = new Intent(this,DetailEventActivity.class);
// Create the view using FirstGroup's LocalActivityManager
View view = FeaturedTabGroup.group.getLocalActivityManager()
.startActivity("show_city", i
.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP))
.getDecorView();
// Again, replace the view
FeaturedTabGroup.group.replaceView(view);
}
});
I’m following this tutorial that switches activities within a tabhost tab, but for some reason my Intent i = new Intent(this,DetailEventActivity.class); is throwing an error.
If I add the code in my onCreate it works, but I want to execute on a click.
See the example code below and edit it according to your usage,