Filter list activity refreshes after creating new list

pull/14/head
Sam Bosley 13 years ago
parent 6ee85f7003
commit 8fc39f3b16

@ -85,6 +85,7 @@ public class FilterListActivity extends ExpandableListActivity {
private static final int REQUEST_CUSTOM_INTENT = 1;
private static final int REQUEST_VIEW_TASKS = 2;
public static final int REQUEST_NEW_BUTTON = 3;
// --- instance variables

@ -11,6 +11,7 @@ import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import android.app.Activity;
import android.app.PendingIntent;
import android.app.PendingIntent.CanceledException;
import android.content.BroadcastReceiver;
import android.content.Context;
@ -39,6 +40,7 @@ import com.timsu.astrid.R;
import com.todoroo.andlib.service.Autowired;
import com.todoroo.andlib.service.DependencyInjectionService;
import com.todoroo.andlib.utility.Preferences;
import com.todoroo.astrid.activity.FilterListActivity;
import com.todoroo.astrid.api.AstridApiConstants;
import com.todoroo.astrid.api.Filter;
import com.todoroo.astrid.api.FilterCategory;
@ -507,7 +509,17 @@ public class FilterAdapter extends BaseExpandableListAdapter {
@Override
public void onClick(View v) {
try {
filter.intent.send();
filter.intent.send(FilterListActivity.REQUEST_NEW_BUTTON, new PendingIntent.OnFinished() {
@Override
public void onSendFinished(PendingIntent pendingIntent, Intent intent,
int resultCode, String resultData, Bundle resultExtras) {
activity.runOnUiThread(new Runnable() {
public void run() {
clear();
}
});
}
}, null);
} catch (CanceledException e) {
// do nothing
}

Loading…
Cancel
Save