1

I tried to use the android support library v7 to add an action bar to my activity my extending tht actionbar activity. A blank fragment has been also built to make a tab. However, the content of the fragment is overlapping the action bar. How can I fix it?

3
  • I am debugging the app using Android 2.1 Emulator Commented Aug 4, 2013 at 13:48
  • Please post your activity layout. Commented Aug 4, 2013 at 14:08
  • 1
    link, fixed by using the correct answer Commented Aug 4, 2013 at 14:35

1 Answer 1

2

I read it here ActionBar with support library and Fragments overlay content I am sure it will help you :

For pre ICS devices you must use:

R.id.action_bar_activity_content 

instead of

android.R.id.content 

R.id.action_bar_activity_content is a new id used in layout for displaying app content, it would appear that it replace android.R.id.content when you use support v7 appcompat ActionBarActivity.

You can use this code to retrieve the correct id of the activity content :

public static int getContentViewCompat() { return Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH ? android.R.id.content : R.id.action_bar_activity_content; } 
Sign up to request clarification or add additional context in comments.

1 Comment

The issue has been fixed. Please read here.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.