4

How can I set (by code) an Activity to be transparent? I want the activity to become transparent when the user clicks a button. Is it possible?

DonGru
  • 13,532
  • 8
  • 45
  • 55
Gabrielle
  • 4,933
  • 13
  • 62
  • 122

1 Answers1

4

You can use setTheme (android.R.style.Theme_Translucent)

But keep the api docs in mind:

Set the base theme for this context. Note that this should be called before any views are instantiated in the Context (for example before calling setContentView(View) or inflate(int, ViewGroup)).

Source