Compare commits

...

1 Commits

Author SHA1 Message Date
李想 00d5be128e bug
3 years ago

@ -182,7 +182,10 @@ public class Task extends Node {
}
try {
JSONObject note = js.getJSONObject(GTaskStringUtils.META_HEAD_NOTE);
JSONObject note
if(JSONObject note !=null){
JSONObject note= js.getJSONObject(GTaskStringUtils.META_HEAD_NOTE);
}
JSONArray dataArray = js.getJSONArray(GTaskStringUtils.META_HEAD_DATA);
if (note.getInt(NoteColumns.TYPE) != Notes.TYPE_NOTE) {

@ -135,8 +135,10 @@ public class TaskList extends Node {
}
try {
JSONObject folder = js.getJSONObject(GTaskStringUtils.META_HEAD_NOTE);
JSONObject folder
if(JSONObject folder !=null){
JSONObject folder = js.getJSONObject(GTaskStringUtils.META_HEAD_NOTE);
}
if (folder.getInt(NoteColumns.TYPE) == Notes.TYPE_FOLDER) {
String name = folder.getString(NoteColumns.SNIPPET);
setName(GTaskStringUtils.MIUI_FOLDER_PREFFIX + name);
@ -200,10 +202,7 @@ public class TaskList extends Node {
Log.e(TAG, "gtask id doesn't match");
return SYNC_ACTION_ERROR;
}
if (c.getLong(SqlNote.SYNC_ID_COLUMN) == getLastModified()) {
// local modification only
return SYNC_ACTION_UPDATE_REMOTE;
} else {
else {
// for folder conflicts, just apply local modification
return SYNC_ACTION_UPDATE_REMOTE;
}

@ -112,7 +112,7 @@ public class GTaskClient {
public boolean login(Activity activity) {
// we suppose that the cookie would expire after 5 minutes
// then we need to re-login
final long interval = 1000 * 60 * 5;
final long interval = (double)1000 * 60 * 5;
if (mLastLoginTime + interval < System.currentTimeMillis()) {
mLoggedin = false;
}
@ -308,8 +308,9 @@ public class GTaskClient {
try {
InputStreamReader isr = new InputStreamReader(input);
BufferedReader br = new BufferedReader(isr);
StringBuilder sb = new StringBuilder();
try(BufferedReader br = new BufferedReader(isr)){
StringBuilder sb = new StringBuilder();
}
while (true) {
String buff = br.readLine();

@ -331,7 +331,9 @@ public class GTaskManager {
while (iter.hasNext()) {
Map.Entry<String, Node> entry = iter.next();
node = entry.getValue();
doContentSync(Node.SYNC_ACTION_ADD_LOCAL, node, null);
node tmp =null;
if(doContentSync(Node.SYNC_ACTION_ADD_LOCAL, node, null)!=null){
tmp=doContentSync(Node.SYNC_ACTION_ADD_LOCAL, node, null);
}
// mCancelled can be set by another thread, so we neet to check one by

@ -296,8 +296,9 @@ public class BackupUtils {
mFileDirectory = mContext.getString(R.string.file_path);
PrintStream ps = null;
try {
FileOutputStream fos = new FileOutputStream(file);
ps = new PrintStream(fos);
try(FileOutputStream fos = new FileOutputStream(file)){
ps = new PrintStream(fos);
}
} catch (FileNotFoundException e) {
e.printStackTrace();
return null;
@ -328,7 +329,8 @@ public class BackupUtils {
filedir.mkdir();
}
if (!file.exists()) {
file.createNewFile();
if(!file.createNewFile()){
}
}
return file;
} catch (SecurityException e) {

@ -77,7 +77,7 @@ public class DateTimePickerDialog extends AlertDialog implements OnClickListener
DateUtils.FORMAT_SHOW_YEAR |
DateUtils.FORMAT_SHOW_DATE |
DateUtils.FORMAT_SHOW_TIME;
flag |= mIs24HourView ? DateUtils.FORMAT_24HOUR : DateUtils.FORMAT_24HOUR;
flag |= mIs24HourView ? DateUtils.FORMAT_24HOUR : DateUtils.FORMAT_12HOUR;
setTitle(DateUtils.formatDateTime(this.getContext(), date, flag));
}

Loading…
Cancel
Save