android toolbar disappeares when I open dialog or switch between apps

27 views Asked by At

I have an android app, in which I made a parent activity (let's say "BaseActivity") that all activities extend from that. In "BaseActivity", I made a toolbar with some images, like this:

setSupportActionBar(toolbar);
        View view = getLayoutInflater().inflate(R.layout.header, binding.getRoot(), false);
        toolbar.addView(view);

It works ok until I use a fragmentdialog (usually this fragment takes some photos) or switch between apps (for example after making call)

while it works ok

after switching app or opening dialog Still other part of app work as I expected.

I need your advice :)

0

There are 0 answers