0

I am working on an Android application. There is a Tab Activity hosting all five tabs at the bottom. I have to start five activities under first tab. How can I achieve this? I am starting but it is replacing only view, not the Activity. I am using below code:

private OnClickListener submitClickListener = new OnClickListener() {

    @Override
    public void onClick(View v) {
    Intent restaurantIntent = new Intent(v.getContext(),
                RestaurantList.class);

        // Activity1 parentActivity = (Activity1)getParent();
        replaceContentView("restaurant", restaurantIntent);
    }
};

public void replaceContentView(String id, Intent newIntent) {
    View view = getLocalActivityManager().startActivity(id,
            newIntent)
            .getDecorView();
    this.setContentView(view);
}

This code is working but not as I intended to. I want to replace the whole activity not the view.

4

0 に答える 0