LPirro
LPirro

Reputation: 254

ActionBar on the TOP and BOTTOM on Android App

I'm developing an Android app and I want to have 2 ActionBar (one on the top and another on the bottom) like this: http://developer.android.com/design/media/action_bar_pattern_considerations.png

I'm using Actionbar Sherlock and for now I created only the top ActionBar. I serched in the web, but I didn't find a solution yet, only some piece of code.

Can anyone help?

Upvotes: 0

Views: 11943

Answers (2)

Gopal Gopi
Gopal Gopi

Reputation: 11131

try this...

public class MainActivity extends SherlockActivity {

    private View contentView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        contentView = getLayoutInflater().inflate(R.layout.activity_main, null);
        setContentView(contentView);
        LinearLayout layout = (LinearLayout) contentView.getParent().getParent();
        View view = layout.getChildAt(0);
        layout.removeViewAt(0);
        layout.addView(view);
    }

Upvotes: 0

Related Questions