hejiaqi_Branch
main
After
Width: | Height: | Size: 72 KiB
@ -42,7 +42,7 @@ public class BackupUtils {
private static BackupUtils sInstance;
public static synchronized BackupUtils getInstance(Context context) {
//ynchronized 关键字,代表这个方法加锁,相当于不管哪一个线程(例如线程A)
//ynchronized 关键字,代表这个方法加锁,相当于不管哪一个线程
//运行到这个方法时,都要检查有没有其它线程B(或者C、 D等)正在用这个方法(或者该类的其他同步方法),有的话要等正在使用synchronized方法的线程B(或者C 、D)运行完这个方法后再运行此线程A,没有的话,锁定调用者,然后直接运行。
//它包括两种用法:synchronized 方法和 synchronized 块。
if (sInstance == null) {
@ -39,7 +39,7 @@ package net.micode.notes.tool;
public class DataUtils {
public static final String TAG = "DataUtils";
public static boolean batchDeleteNotes(ContentResolver resolver, HashSet<Long> ids) { //直接删除多个笔记
public static boolean batchDeleteNotes(ContentResolver resolver, HashSet<Long> ids) { //直接删除笔记
if (ids == null) {
Log.d(TAG, "the ids is null");
return true;
@ -14,7 +14,7 @@
* limitations under the License.
*/
//定义了很多的静态字符串,提供jsonObject中相应字符串的"key"。
//定义了静态字符串,提供jsonObject中相应字符串
package net.micode.notes.tool;
//这个类定义了jsonObject提供Key
@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
//
import android.content.Context;
Width: | Height: | Size: 15 KiB