@ -80,6 +80,9 @@ public class DataUtils {
return false ;
return false ;
}
}
/ * *
* 移 动 便 签 到 文 件 夹
* /
public static void moveNoteToFoler ( ContentResolver resolver , long id , long srcFolderId , long desFolderId ) {
public static void moveNoteToFoler ( ContentResolver resolver , long id , long srcFolderId , long desFolderId ) {
ContentValues values = new ContentValues ( ) ;
ContentValues values = new ContentValues ( ) ;
values . put ( NoteColumns . PARENT_ID , desFolderId ) ;
values . put ( NoteColumns . PARENT_ID , desFolderId ) ;
@ -88,6 +91,9 @@ public class DataUtils {
resolver . update ( ContentUris . withAppendedId ( Notes . CONTENT_NOTE_URI , id ) , values , null , null ) ;
resolver . update ( ContentUris . withAppendedId ( Notes . CONTENT_NOTE_URI , id ) , values , null , null ) ;
}
}
/ * *
* 脚 本 移 动 到 文 件 夹 中
* /
public static boolean batchMoveToFolder ( ContentResolver resolver , HashSet < Long > ids ,
public static boolean batchMoveToFolder ( ContentResolver resolver , HashSet < Long > ids ,
long folderId ) {
long folderId ) {
if ( ids = = null ) {
if ( ids = = null ) {
@ -103,7 +109,7 @@ public class DataUtils {
builder . withValue ( NoteColumns . LOCAL_MODIFIED , 1 ) ;
builder . withValue ( NoteColumns . LOCAL_MODIFIED , 1 ) ;
operationList . add ( builder . build ( ) ) ;
operationList . add ( builder . build ( ) ) ;
}
}
//异常捕获
try {
try {
ContentProviderResult [ ] results = resolver . applyBatch ( Notes . AUTHORITY , operationList ) ;
ContentProviderResult [ ] results = resolver . applyBatch ( Notes . AUTHORITY , operationList ) ;
if ( results = = null | | results . length = = 0 | | results [ 0 ] = = null ) {
if ( results = = null | | results . length = = 0 | | results [ 0 ] = = null ) {