How do i darken/dim the current screen on click of a button. PLease help me.
Share
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.
Here’s one solution, though it may not be the best:
create styles.xml under res/values. Add the following code:
Note that
@color/cache_coloris<color name="cache_color">#00000000</color>. Now clicking your custom button should send an intent to an activity (e.g., FooActivity). So declare this in your manifest:and voila, the screen is dimmed when your button’s listener is called!