Code example for AppWidgetHost

Methods: deleteHost

0
                    "sortType INTEGER" + 
                    ");"); 
 
            // Database was just created, so wipe any previous widgets 
            if (mAppWidgetHost != null) {
                mAppWidgetHost.deleteHost();
                sendAppWidgetResetNotify(); 
            } 
 
            if (!convertDatabase(db)) {
                // Set a shared pref so that we know we need to load the default workspace later 
                setFlagToLoadDefaultWorkspaceLater(); 
            } 
        } 
 
        private void setFlagToLoadDefaultWorkspaceLater() { 
            String spKey = LauncherApplication.getSharedPreferencesKey();
            SharedPreferences sp = mContext.getSharedPreferences(spKey, Context.MODE_PRIVATE);
            SharedPreferences.Editor editor = sp.edit();
            editor.putBoolean(DB_CREATED_BUT_DEFAULT_WORKSPACE_NOT_LOADED, true);
Contextual code suggestions in your IDE  Get Codota for Java