Android BackupManager - 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 BackupManager class.

This code example shows how to use the following methods:dataChanged
        Editor editor = getSharedPreferences(PREF_NAME, MODE_PRIVATE).edit();
        editor.putString(BACKUP_TEST, "リストアされました!");
        editor.commit();
 
        // BackupManagerインスタンスを生成して 
        BackupManager backupManager = new BackupManager(this);
        // 明示的に通知 
        backupManager.dataChanged();
    } 
 
    public void onRestoreCheckClick(View view) {
        SharedPreferences sp = getSharedPreferences(PREF_NAME, MODE_PRIVATE);
        String string = sp.getString(BACKUP_TEST, "できてなければこっち");
 
        // リストアできていれば 
        new AlertDialog.Builder(this).setMessage(string).show();
    } 
 
    private void showToast(String text) {
        Toast.makeText(this, text, Toast.LENGTH_SHORT).show();
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
	/** 
	 * Calls {@link BackupManager#dataChanged()}. 
	 */ 
	public static void dataChanged(Context context)
	{ 
		new BackupManager(context).dataChanged();
	} 
 
	/** 
	 * Creates an audio focus listener that calls back to {@link PlaybackService#onAudioFocusChange(int)}. 
	 */ 
	public static void createAudioFocus() 
	{ 
		sAudioFocus = new CompatFroyo();
	} 
 
	/** 
	 * Calls {@link AudioManager#requestAudioFocus(AudioManager.OnAudioFocusChangeListener, int, int)} 
	 */ 
	public static void requestAudioFocus(AudioManager manager)
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:dataChanged
        SQLiteDatabase db = mOpenHelper.getWritableDatabase();
        long rowId = db.insert(USERDICT_TABLE_NAME, Words.WORD, values);
        if (rowId > 0) {
            Uri wordUri = ContentUris.withAppendedId(UserDictionary.Words.CONTENT_URI, rowId);
            getContext().getContentResolver().notifyChange(wordUri, null);
            mBackupManager.dataChanged();
            return wordUri;
        } 
 
        throw new SQLException("Failed to insert row into " + uri);
    } 
 
    @Override 
    public int delete(Uri uri, String where, String[] whereArgs) {
        SQLiteDatabase db = mOpenHelper.getWritableDatabase();
        int count;
        switch (sUriMatcher.match(uri)) {
        case WORDS:
            count = db.delete(USERDICT_TABLE_NAME, where, whereArgs);
            break; 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:dataChanged
		backup(); 
	} 
 
	@Override 
	public void backup() { 
		backupMgr.dataChanged();
	} 
} 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:dataChanged
		mBackuper = new BackupManager(diagram.getContext());
	} 
 
	public void notifyBackupManager() 
	{ 
		mBackuper.dataChanged();
	} 
	 
/* 
	public void requestRestore() 
	{ 
		mBackuper.requestRestore( 
				new RestoreObserver() { 
					@Override 
					public void restoreStarting(int numPackages) { 
						Log.d(TAG, "Restore from cloud starting."); 
						super.restoreStarting(numPackages); 
					} 
					 
					@Override 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:dataChanged
 */ 
@TargetApi(Build.VERSION_CODES.FROYO)
public class FroyoBackupManagerFeature implements BackupManagerFeature { 
    @Override 
    public void dataChanged(Context context) {
        final BackupManager bm = new BackupManager(context);
        bm.dataChanged();
    } 
} 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:dataChanged
	public static void checkAvailable() { 
	} 
 
	public void dataChanged() { 
		Log.d(LOG_TAG, "dataChanged()");
		mInstance.dataChanged();
	} 
 
	private BackupManager mInstance;
 
	public BackupManagerWrapper(Context ctx) {
		mInstance = new BackupManager(ctx);
	} 
} 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:dataChanged
		editor.putString(UUID_KEY, uuid);
		editor.commit();
	} 
	 
	private static void askForBackup(Context context) {
		BackupManager manager = new BackupManager(context);
		// ask manager to be launch a back up 
		manager.dataChanged();
	} 
} 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
	//                                    CONSTRUCTOR AND INSTANCE GETTERS                                        //        
	// ---------------------------------------------------------------------------------------------------------- // 
     
	public SharedPreferencesOperationsFroyo(Context context, String mSharedPreferencesName) { 
		super(context, mSharedPreferencesName); 
		backupManager = new BackupManager(context); 
	} 
	 
	public synchronized static SharedPreferencesOperations getInstance(Context context, String mSharedPreferencesName) { 
		if (TextUtils.isEmpty(mSharedPreferencesName)) { 
			throw new UnsupportedOperationException("SharedPreferencesName must not be empty or null"); 
		} 
		if (sharedPreferencesName.equals(mSharedPreferencesName) && instanceRef != null && instanceRef.get() != null) { 
			return instanceRef.get(); 
		} else { 
			instanceRef = new SoftReference<SharedPreferencesOperations>(new SharedPreferencesOperationsFroyo(context, mSharedPreferencesName)); 
			return instanceRef.get();	 
		} 
	} 
	 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
        return inflater.inflate(R.layout.fragment_configure_advanced, container, false);
    } 
 
    @Override 
    public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String s) {
        new BackupManager(getActivity()).dataChanged();
    } 
} 
4
CodeRank
Experience pair programming with AI  Get Codota for Java

Related Android BackupManager Questions & Answers:

See Code Examples for Android BackupManager Methods: