Advertisement
praveen

Backup the Application's

Sep 27th, 2011
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. public int runBackup(Uri uri)
  2. {
  3. int count=0;
  4. String file = uri.getHost() +"-"+ System.currentTimeMillis();
  5.  
  6. Cursor cursor = cr.query(uri, null, null, null, null);
  7. count = cursorToCSV(cursor, file);
  8. cursor.close();
  9.  
  10. String msg = String.format("Backed up %d records to %s file", count, file);
  11. Toast.makeText(context, msg, Toast.LENGTH_SHORT).show();
  12. return count;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement