In my application, I want to make screen translucent at runtime on a click of a button.
I tried
setTheme(android.R.style.Theme_Translucent_NoTitleBar);
in the onClick() method, but it did not work. Is there any way to achieve this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The answer is to set theme before views are instantiated as @Selvin said. To do that, I restarted my activity on click of my button with some different theme.