Code example for AppWidgetHost

Methods: startListening

0
     
    @Override 
    public void onResume() { 
    	super.onResume(); 
    	 
    	if (mAppWidgetHost != null) mAppWidgetHost.startListening();
    	 
    	updateClock(); 
    } 
     
    @Override 
    public void onDestroy() { 
 
        super.onDestroy(); 
 
        try { 
            mAppWidgetHost.stopListening();
        } catch (NullPointerException ex) {
            Log.w("lockscreen destroy", "problem while stopping AppWidgetHost during Lockscreen destruction", ex);
        } 
    }