|
|
@ -22,7 +22,9 @@ package com.todoroo.astrid.reminders;
|
|
|
|
import android.app.Activity;
|
|
|
|
import android.app.Activity;
|
|
|
|
import android.content.Intent;
|
|
|
|
import android.content.Intent;
|
|
|
|
import android.os.Bundle;
|
|
|
|
import android.os.Bundle;
|
|
|
|
|
|
|
|
import android.widget.Toast;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.timsu.astrid.R;
|
|
|
|
import com.todoroo.andlib.sql.QueryTemplate;
|
|
|
|
import com.todoroo.andlib.sql.QueryTemplate;
|
|
|
|
import com.todoroo.astrid.activity.TaskListActivity;
|
|
|
|
import com.todoroo.astrid.activity.TaskListActivity;
|
|
|
|
import com.todoroo.astrid.api.Filter;
|
|
|
|
import com.todoroo.astrid.api.Filter;
|
|
|
@ -40,10 +42,7 @@ public class NotificationActivity extends Activity {
|
|
|
|
// --- constants
|
|
|
|
// --- constants
|
|
|
|
|
|
|
|
|
|
|
|
/** task id from notification */
|
|
|
|
/** task id from notification */
|
|
|
|
public static final String TOKEN_ID = "id";
|
|
|
|
public static final String TOKEN_ID = "id"; //$NON-NLS-1$
|
|
|
|
|
|
|
|
|
|
|
|
/** task title */
|
|
|
|
|
|
|
|
public static final String TOKEN_TITLE = "title";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// --- implementation
|
|
|
|
// --- implementation
|
|
|
|
|
|
|
|
|
|
|
@ -68,14 +67,17 @@ public class NotificationActivity extends Activity {
|
|
|
|
|
|
|
|
|
|
|
|
Intent taskListIntent = new Intent(this, TaskListActivity.class);
|
|
|
|
Intent taskListIntent = new Intent(this, TaskListActivity.class);
|
|
|
|
Filter itemFilter = new Filter(ReminderPlugin.IDENTIFIER,
|
|
|
|
Filter itemFilter = new Filter(ReminderPlugin.IDENTIFIER,
|
|
|
|
"Notification",
|
|
|
|
getString(R.string.rmd_NoA_filter),
|
|
|
|
"Notification",
|
|
|
|
getString(R.string.rmd_NoA_filter),
|
|
|
|
new QueryTemplate().where(TaskCriteria.byId(id)),
|
|
|
|
new QueryTemplate().where(TaskCriteria.byId(id)),
|
|
|
|
null);
|
|
|
|
null);
|
|
|
|
|
|
|
|
|
|
|
|
taskListIntent.putExtra(TaskListActivity.TOKEN_FILTER, itemFilter);
|
|
|
|
taskListIntent.putExtra(TaskListActivity.TOKEN_FILTER, itemFilter);
|
|
|
|
startActivity(taskListIntent);
|
|
|
|
startActivity(taskListIntent);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String reminder = Notifications.getRandomReminder(getResources().getStringArray(R.array.reminder_responses));
|
|
|
|
|
|
|
|
Toast.makeText(this, reminder, Toast.LENGTH_LONG).show();
|
|
|
|
|
|
|
|
|
|
|
|
finish();
|
|
|
|
finish();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|