0

I have an alarm Receiver which do some work at the time which the user sets in an Activity. I want to make all screen white when the class Receives alarm!! . Is it possible? How can I do that? I have searched in google and found some answers to make application full screen! I don't know what should i search for my goal.

public class AlarmReceiver extends WakefulBroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
    // make whole screen white(or any color)
    }
}
Meysam Valueian
  • 661
  • 1
  • 5
  • 21
  • maybe this will work for you: http://stackoverflow.com/questions/8961071/android-changing-background-color-of-the-activity-main-view – spirit Aug 20 '16 at 09:37

1 Answers1

0
@Override
    public void onReceive(Context context, Intent intent) {
        if (intent != null) {
            if(MainActivity.getInstace()!=null)
                MainActivity.getInstace().updateUI();
}

and make a public function in YourActivity where you want to FULL COLOR SCREEN

public void updateUI() {
    MainActivity.this.runOnUiThread(new Runnable() {
        public void run() {
          //DO YOUR CHANGE
         //put background color in main layout
        }
    });
}

Make an activity with receiver and UI, so need to make a separate receiver.

Hope this hint helps you..

Nikhil Borad
  • 2,065
  • 16
  • 20