Android AppWidgetHost - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android AppWidgetHost class.

This code example shows how to use the following methods: createView, deleteAppWidgetId
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: deleteHost
                    "displayMode 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);
Full Snippet Info
2
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: startListening
    public void startUpdate(View arg0) {
    } 
 
    public void onShow() { 
        if (mAppWidgetHost != null) {
            mAppWidgetHost.startListening();
        } 
    } 
 
    public void onHide() { 
        if (mAppWidgetHost != null) {
            mAppWidgetHost.stopListening();
        } 
    } 
 
} 
Full Snippet Info
5
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: deleteHost
                    "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);
Full Snippet Info
2
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: deleteHost
                    "icon BLOB" + 
                    ");"); 
 
            // Database was just created, so wipe any previous widgets 
            if (mAppWidgetHost != null) {
                mAppWidgetHost.deleteHost();
                sendAppWidgetResetNotify(); 
            } 
             
            if (!convertDatabase(db)) {
                // Populate favorites table with initial favorites 
                loadFavorites(db);
            } 
        } 
 
        private boolean convertDatabase(SQLiteDatabase db) {
            if (LOGD) Log.d(LOG_TAG, "converting database from an older format, but not onUpgrade");
            boolean converted = false;
 
            final Uri uri = Uri.parse("content://" + Settings.AUTHORITY +
Full Snippet Info
4
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related Android AppWidgetHost Questions & Answers:

See Code Examples for Android AppWidgetHost Methods: