Android Libs Blurry Not Working

Viewed 2538

I use https://github.com/wasabeef/Blurry library.

in Onclick, the following code works.

private boolean blurred = false;

if (blurred) {
      Blurry.delete((ViewGroup) findViewById(R.id.content));
    } else {
      long startMs = System.currentTimeMillis();
      Blurry.with(MainActivity.this)
          .radius(25)
          .sampling(2)
          .async()
          .animate(500)
          .onto((ViewGroup) findViewById(R.id.content));
    }
blurred = !blurred;

But when I add the following code in OnCreate, it doesn't work.

Blurry.with(MainActivity.this)
      .radius(25)
      .sampling(2)
      .async()
      .animate(500)
      .onto((ViewGroup) findViewById(R.id.content));
1 Answers
Related