skip to Main Content

It shows app name and fragment toolbar even if I use supportActionBar.hide and Theme.MaterialComponents.DayNight.NoActionBar

enter image description here

2

Answers


  1. Add this in style

    <style name="Theme.ProjectName.NoActionBar">
        <item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>
    </style>
    

    Then add this in activity tag inside manifest

    android:theme="@style/Theme.ProjectName.NoActionBar"
    
    Login or Signup to reply.
  2. You are adding PlaceholderFragment in your activity. –>

    if (savedInstanceState == null) {
    getFragmentManager().beginTransaction().add(R.id.your_container, new 
    PlaceholderFragment()).commit();
    }
    

    Now PlaceholderFragment class is inflating the same layout as your activity as –>

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle 
    savedInstanceState) {
    View rootView = inflater.inflate(R.layout.main, container, false);
    return rootView;
    }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search