0

I'm trying to hide actionBar in my tabbed activity, i almost did it, but white line (on the top of the screen ) left on the screen. How to hide it?

enter image description here

My Activity code:

 @Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);
    setContentView(R.layout.activity_main2);

    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    // Create the adapter that will return a fragment for each of the three
    // primary sections of the activity.
    mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());

    // Set up the ViewPager with the sections adapter.
    mViewPager = (ViewPager) findViewById(R.id.container);
    mViewPager.setAdapter(mSectionsPagerAdapter);
    mViewPager.setCurrentItem(1);

    ActionBar bar = getSupportActionBar();
    if(bar != null) {
        bar.hide();

    }

In Manifest i set:

android:theme="@style/Theme.AppCompat.Light.NoActionBar"
Big Coach
  • 2,485
  • 2
  • 12
  • 31

0 Answers0