Java Code Examples for android.content.Intent#ACTION_PACKAGE_RESTARTED

The following examples show how to use android.content.Intent#ACTION_PACKAGE_RESTARTED . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PreventActivity.java    From prevent with Do What The F*ck You Want To Public License 6 votes vote down vote up
@Override
protected void onResume() {
    super.onResume();
    IntentFilter filter = new IntentFilter(Intent.ACTION_PACKAGE_RESTARTED);
    filter.addDataScheme("package");
    registerReceiver(receiver, filter);
    stopped = false;
    mainHandler.postDelayed(new Runnable() {
        @Override
        public void run() {
            if (!stopped) {
                updateTimeIfNeeded(null);
                mainHandler.postDelayed(this, 0x3e8);
            }
        }
    }, 0x3e8);
}