Code example for AppWidgetHost

Methods: stopListening

0
    @Override 
    public void onPause() { 
    	super.onPause(); 
    	 
    	try { 
    	     mAppWidgetHost.stopListening();
    	 } catch (NullPointerException ex) {
    	     Log.w("lockscreen pause", "problem while stopping AppWidgetHost during Lockscreen destruction", ex);
    	 } 
    } 
     
    @Override 
    public void onResume() { 
    	super.onResume(); 
    	 
    	if (mAppWidgetHost != null) mAppWidgetHost.startListening();
    	 
    	updateClock(); 
    } 
     
Experience pair programming with AI  Get Codota for Java