2

I have a tab bar in my application, with third tab named About. When user clicks on this About tab, I want activity to be displayed with blur effect. More specifically, About activity should be on front, while previous tab should be displayed behind with blur effect. I did the following code in the about.java onCreate Method, but it opens new window and the previous windows are not being displayed.

public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        //This is the code used to add blur effect
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND,
                WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
        setContentView(R.layout.about);
}

If I do it without tab bar it works. Any suggestions on what might be going wrong or how to do it in a different way?

Monolo
  • 18,205
  • 17
  • 69
  • 103
Shah
  • 4,990
  • 10
  • 48
  • 70

1 Answers1

2

I solved the problem. I added few of the Styles in res/value/styles.xml file and added the theme in AndroidMenifest.xml file.

Oak Bytes
  • 4,649
  • 4
  • 36
  • 53
Shah
  • 4,990
  • 10
  • 48
  • 70
  • Can you please share those styles you used? – Muhammad Zahab Feb 19 '20 at 07:05
  • @MuhammadZahabAhmedKhan, Apologies I do not have that project now. Let me know what is your problem and I can try to fix that for you – Shah Feb 20 '20 at 03:14
  • I want a blurry screen effect like fog. And when some one draw with finger on it. It behaves like mirror of car having fog on it. https://stackoverflow.com/questions/16643675/create-a-foggy-effect-on-screen?lq=1 here is the image what i want. – Muhammad Zahab Feb 20 '20 at 09:34