[fix]修改BUG,成功运行

zxp
tabzzz 2 years ago
parent b69da42a45
commit ba89f3efba

@ -17,6 +17,7 @@
package net.micode.notes.gtask.remote;
import android.annotation.SuppressLint;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
@ -31,19 +32,20 @@ import net.micode.notes.ui.NotesPreferenceActivity;
public class GTaskASyncTask extends AsyncTask<Void, String, Integer> {
private static int GTASK_SYNC_NOTIFICATION_ID = 5234235;
private static final int GTASK_SYNC_NOTIFICATION_ID = 5234235;
public interface OnCompleteListener {
void onComplete();
}
private Context mContext;
@SuppressLint("StaticFieldLeak")
private final Context mContext;
private NotificationManager mNotifiManager;
private final NotificationManager mNotifiManager;
private GTaskManager mTaskManager;
private final GTaskManager mTaskManager;
private OnCompleteListener mOnCompleteListener;
private final OnCompleteListener mOnCompleteListener;
public GTaskASyncTask(Context context, OnCompleteListener listener) {
mContext = context;
@ -58,11 +60,10 @@ public class GTaskASyncTask extends AsyncTask<Void, String, Integer> {
}
public void publishProgess(String message) {
publishProgress(new String[] {
message
});
publishProgress(message);
}
@SuppressLint("UnspecifiedImmutableFlag")
private void showNotification(int tickerId, String content) {
Notification notification = new Notification(R.drawable.notification, mContext
.getString(tickerId), System.currentTimeMillis());
@ -77,8 +78,9 @@ public class GTaskASyncTask extends AsyncTask<Void, String, Integer> {
pendingIntent = PendingIntent.getActivity(mContext, 0, new Intent(mContext,
NotesListActivity.class), 0);
}
notification.setLatestEventInfo(mContext, mContext.getString(R.string.app_name), content,
pendingIntent);
// notification.setLatestEventInfo(mContext, mContext.getString(R.string.app_name), content,
// pendingIntent);
notification.contentIntent = pendingIntent;
mNotifiManager.notify(GTASK_SYNC_NOTIFICATION_ID, notification);
}

@ -135,6 +135,8 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt
private final static int REQUEST_CODE_OPEN_NODE = 102;
private final static int REQUEST_CODE_NEW_NODE = 103;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

Loading…
Cancel
Save