@Override public void onClick(View v) { int id = v.getId(); if (id == R.id.cling_dismiss_migration_use_default) { // Disable the migration cling dismissMigrationCling(); } else if (id == R.id.cling_dismiss_migration_copy_apps) { // Copy the shortcuts from the old database LauncherModel model = mLauncher.getModel(); model.resetLoadedState(false, true); model.startLoader( false, PagedView.INVALID_RESTORE_PAGE, LauncherModel.LOADER_FLAG_CLEAR_WORKSPACE | LauncherModel.LOADER_FLAG_MIGRATE_SHORTCUTS); // Set the flag to skip the folder cling String spKey = LauncherAppState.getSharedPreferencesKey(); SharedPreferences sp = mLauncher.getSharedPreferences(spKey, Context.MODE_PRIVATE); SharedPreferences.Editor editor = sp.edit(); editor.putBoolean(Launcher.USER_HAS_MIGRATED, true); editor.apply(); // Disable the migration cling dismissMigrationCling(); } else if (id == R.id.cling_dismiss_longpress_info) { dismissLongPressCling(); } }
@Override public void onChange(boolean selfChange) { mModel.startLoader(LauncherApplication.this, false); }