Back to project page TodoList.
The source code is released under:
Apache License
If you think the Android project TodoList listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package lyc.app; // ww w . j a v a 2 s .co m import android.app.IntentService; import android.content.Intent; import android.database.Cursor; import android.util.Log; /** * Created by ivan on 14-10-23. */ public class TodoService extends IntentService { private static final String TAG = "TodoService"; public TodoService() { super("TodoService"); } @Override public void onCreate() { super.onCreate(); } @Override protected void onHandleIntent(Intent intent) { Cursor cursor = getContentResolver() .query(App.Todo.CONTENT_URI, null, " strftime('%s', " + App.Todo.COLUMN_PLAN_FINISHED_DATE + "/1000, 'unixepoch', 'localtime') - strftime('%s', 'now', 'localtime') < " + 3 * 3600 + " and " + App.Todo.COLUMN_STATUS + " = ?", new String[]{String.valueOf(App.Todo.STATUS_UNFINISHED)}, null); Log.d(TAG, "count = " + cursor.getCount()); if (cursor.getCount() > 0) { //trigger notifications while (cursor.moveToNext()) { Log.d(TAG, cursor.getString(cursor.getColumnIndex(App.Todo.COLUMN_TITLE))); } } } }