Merge origin/111027_sb_final_release_tweaks

pull/14/head
Sam Bosley 14 years ago
commit 41bcb2c09f

@ -1,5 +1,7 @@
package com.todoroo.astrid.sync;
import java.util.concurrent.atomic.AtomicBoolean;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.app.Service;
@ -45,12 +47,15 @@ abstract public class SyncBackgroundService extends Service {
DependencyInjectionService.getInstance().inject(this);
}
private final AtomicBoolean started = new AtomicBoolean(false);
/** Receive the alarm - start the synchronize service! */
@Override
public void onStart(Intent intent, int startId) {
try {
if(intent != null)
if(intent != null && !started.getAndSet(true)) {
startSynchronization(this);
}
} catch (Exception e) {
exceptionService.reportError(getSyncUtilities().getIdentifier() + "-bg-sync", e); //$NON-NLS-1$
}
@ -67,8 +72,6 @@ abstract public class SyncBackgroundService extends Service {
return;
getSyncProvider().synchronize(context);
stopSelf();
}
@Override
@ -76,6 +79,11 @@ abstract public class SyncBackgroundService extends Service {
return null;
}
public synchronized void stop() {
started.set(false);
stopSelf();
}
// --- alarm management
/**

@ -11,7 +11,6 @@ import java.util.HashMap;
import android.app.Activity;
import android.app.Notification;
import android.app.Service;
import android.content.Context;
import android.widget.Toast;
@ -162,7 +161,7 @@ public abstract class SyncProvider<TYPE extends SyncContainer> {
});
}
initiateManual((Activity)context);
} else if(context instanceof Service) {
} else if(context instanceof SyncBackgroundService) {
// display notification
final int notificationId = updateNotification(context, notification);
final NotificationManager nm = new NotificationManager.AndroidNotificationManager(context);
@ -175,6 +174,7 @@ public abstract class SyncProvider<TYPE extends SyncContainer> {
initiateBackground();
} finally {
nm.cancel(notificationId);
((SyncBackgroundService)context).stop();
}
}
}).start();

@ -17,7 +17,6 @@
<classpathentry exported="true" kind="lib" path="libs/guava-r09.jar"/>
<classpathentry exported="true" kind="lib" path="libs/jackson-core-asl-1.6.7.jar"/>
<classpathentry kind="lib" path="libs/crittercism1.01.jar"/>
<classpathentry exported="true" kind="lib" path="libs/google-api-services-tasks-v1-1.2.2-beta.jar" sourcepath="libs/google-api-services-tasks-v1-1.2.2-beta-sources.jar"/>
<classpathentry exported="true" kind="lib" path="libs/google-api-client-1.5.0-beta.jar"/>
<classpathentry kind="lib" path="libs/google-api-client-extensions-1.5.0-beta.jar"/>
<classpathentry exported="true" kind="lib" path="libs/google-api-client-extensions-android2-1.5.0-beta.jar"/>
@ -30,5 +29,6 @@
<classpathentry kind="src" path="GreenDroid_src"/>
<classpathentry kind="src" path="astridApi_src"/>
<classpathentry kind="src" path="facebook_src"/>
<classpathentry exported="true" kind="lib" path="libs/google-api-services-tasks-v1-1.2.5-beta.jar"/>
<classpathentry kind="output" path="ecbuild"/>
</classpath>

@ -74,8 +74,8 @@ public class C2DMReceiver extends BroadcastReceiver {
new Thread(new Runnable() {
@Override
public void run() {
if(intent.hasExtra("web_update"))
if (DateUtilities.now() - actFmPreferenceService.getLastSyncDate() > MIN_MILLIS_BETWEEN_FULL_SYNCS)
if(intent.hasExtra("web_update") && actFmPreferenceService.isLoggedIn())
if (DateUtilities.now() - actFmPreferenceService.getLastSyncDate() > MIN_MILLIS_BETWEEN_FULL_SYNCS && !actFmPreferenceService.isOngoing())
new ActFmSyncProvider().synchronize(ContextManager.getContext());
else
handleWebUpdate(intent);

@ -24,6 +24,7 @@ import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
import java.security.NoSuchAlgorithmException;
import java.util.Random;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicReference;
@ -63,6 +64,7 @@ import com.todoroo.andlib.service.Autowired;
import com.todoroo.andlib.service.ContextManager;
import com.todoroo.andlib.service.DependencyInjectionService;
import com.todoroo.andlib.service.ExceptionService;
import com.todoroo.andlib.utility.DateUtilities;
import com.todoroo.andlib.utility.DialogUtilities;
import com.todoroo.andlib.utility.Preferences;
import com.todoroo.astrid.actfm.sync.ActFmInvoker;
@ -91,6 +93,7 @@ public class ActFmLoginActivity extends Activity implements AuthListener {
@Autowired
protected ActFmPreferenceService actFmPreferenceService;
private final ActFmInvoker actFmInvoker = new ActFmInvoker();
private Random rand;
private Facebook facebook;
private AsyncFacebookRunner facebookRunner;
@ -134,6 +137,8 @@ public class ActFmLoginActivity extends Activity implements AuthListener {
setContentView(getContentViewResource());
setTitle(getTitleResource());
rand = new Random(DateUtilities.now());
noSync = getIntent().getBooleanExtra(EXTRA_DO_NOT_SYNC, false);
facebook = new Facebook(APP_ID);
@ -233,6 +238,7 @@ public class ActFmLoginActivity extends Activity implements AuthListener {
isNew.set(!isNew.get());
int nameIndex = body.indexOfChild(name);
int visibility = isNew.get() ? View.VISIBLE : View.GONE;
int passwordVisibility = isNew.get() ? View.GONE : View.VISIBLE;
toggleNew.setText(isNew.get() ? R.string.actfm_ALA_pw_returning
: R.string.actfm_ALA_pw_new);
dialog.get().setTitle(
@ -240,6 +246,12 @@ public class ActFmLoginActivity extends Activity implements AuthListener {
: R.string.actfm_ALA_login_title);
body.getChildAt(nameIndex - 1).setVisibility(visibility);
body.getChildAt(nameIndex).setVisibility(visibility);
EditText password = (EditText) body.getChildAt(nameIndex + 4);
String passwordText = isNew.get() ? generateRandomPassword() : ""; //$NON-NLS-1$
password.setText(passwordText);
body.getChildAt(nameIndex + 3).setVisibility(passwordVisibility);
body.getChildAt(nameIndex + 4).setVisibility(passwordVisibility);
}
});
toggleNew.setText(R.string.actfm_ALA_pw_returning);
@ -259,6 +271,10 @@ public class ActFmLoginActivity extends Activity implements AuthListener {
R.string.actfm_ALA_password_label);
password.setTransformationMethod(new PasswordTransformationMethod());
password.setText(generateRandomPassword());
body.getChildAt(body.indexOfChild(password) - 1).setVisibility(View.GONE);
password.setVisibility(View.GONE);
dialog.set(new AlertDialog.Builder(ActFmLoginActivity.this).setView(
body).setIcon(R.drawable.icon_32).setTitle(
R.string.actfm_ALA_signup_title).setPositiveButton(
@ -282,6 +298,35 @@ public class ActFmLoginActivity extends Activity implements AuthListener {
}
};
private String generateRandomPassword() {
String acceptable = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!@#$%^&*(),."; //$NON-NLS-1$
char[] chars = new char[8];
char last = 'a';
for (int i = 0; i < chars.length; i++) {
char r = acceptable.charAt(rand.nextInt(acceptable.length()));
while (checkSimilar(last, r))
r = acceptable.charAt(rand.nextInt(acceptable.length()));
last = r;
chars[i] = r;
}
return new String(chars);
}
@SuppressWarnings("nls")
private boolean checkSimilar(char last, char check) {
String iSimilar = "ijl1!";
String oSimilar = "oO0";
String puncSimilar = ".,";
boolean match = (iSimilar.indexOf(last) > 0 && iSimilar.indexOf(check) > 0)
|| (oSimilar.indexOf(last) > 0 && oSimilar.indexOf(check) > 0)
|| (puncSimilar.indexOf(last) > 0 && puncSimilar.indexOf(check) > 0);
if (match)
return false;
return true;
}
private EditText addEditField(LinearLayout body, int hint) {
TextView label = new TextView(ActFmLoginActivity.this);
label.setText(hint);

@ -55,7 +55,6 @@ import com.todoroo.astrid.data.TagData;
import com.todoroo.astrid.data.Task;
import com.todoroo.astrid.data.Update;
import com.todoroo.astrid.service.MetadataService;
import com.todoroo.astrid.service.StartupService;
import com.todoroo.astrid.service.StatisticsConstants;
import com.todoroo.astrid.service.StatisticsService;
import com.todoroo.astrid.service.TagDataService;
@ -119,6 +118,8 @@ public final class ActFmSyncService {
public void onModelUpdated(final Task model) {
if(Flags.checkAndClear(Flags.ACTFM_SUPPRESS_SYNC))
return;
if (actFmPreferenceService.isOngoing())
return;
final ContentValues setValues = model.getSetValues();
if(setValues == null || !checkForToken() || setValues.containsKey(RemoteModel.REMOTE_ID_PROPERTY_NAME))
return;
@ -145,6 +146,8 @@ public final class ActFmSyncService {
public void onModelUpdated(final Update model) {
if(Flags.checkAndClear(Flags.ACTFM_SUPPRESS_SYNC))
return;
if (actFmPreferenceService.isOngoing())
return;
final ContentValues setValues = model.getSetValues();
if(setValues == null || !checkForToken() || model.getValue(Update.REMOTE_ID) > 0)
return;
@ -163,6 +166,8 @@ public final class ActFmSyncService {
public void onModelUpdated(final TagData model) {
if(Flags.checkAndClear(Flags.ACTFM_SUPPRESS_SYNC))
return;
if (actFmPreferenceService.isOngoing())
return;
final ContentValues setValues = model.getSetValues();
if(setValues == null || !checkForToken() || setValues.containsKey(RemoteModel.REMOTE_ID_PROPERTY_NAME))
return;
@ -276,9 +281,9 @@ public final class ActFmSyncService {
*/
public void pushTaskOnSave(Task task, ContentValues values) {
long remoteId;
if(task.containsValue(Task.REMOTE_ID))
if(task.containsValue(Task.REMOTE_ID)) {
remoteId = task.getValue(Task.REMOTE_ID);
else {
} else {
Task taskForRemote = taskService.fetchById(task.getId(), Task.REMOTE_ID);
if(taskForRemote == null)
return;
@ -292,9 +297,14 @@ public final class ActFmSyncService {
if(newlyCreated) {
if(task.getValue(Task.TITLE).length() == 0)
return;
if(task.getId() <= StartupService.INTRO_TASK_SIZE)
for(int taskTitle : new int[] { R.string.intro_task_1_summary,
R.string.intro_task_2_summary, R.string.intro_task_3_summary }) {
String title = ContextManager.getString(taskTitle);
if(task.getValue(Task.TITLE).equals(title))
return;
}
values = task.getMergedValues();
}
if(values.containsKey(Task.TITLE.name)) {
params.add("title"); params.add(task.getValue(Task.TITLE));

@ -24,6 +24,12 @@ public class CreateRequest extends PushRequest {
return service.createGtask(listId, toPush, parent, priorSiblingId);
}
@Override
protected void recover() {
parent = null;
priorSiblingId = null;
}
public String getParent() {
return parent;
}

@ -29,6 +29,12 @@ public class MoveListRequest extends PushRequest {
return service.createGtask(dstList, toPush);
}
@Override
protected void recover() {
//If there's a good way to recover, put it here
//Since MoveListRequest isn't actually used at the moment, it's probably fine for now
}
private void transferProperties(Task local) {
toPush.setCompleted(local.getCompleted());
toPush.setDeleted(local.getDeleted());

@ -34,6 +34,12 @@ public class MoveRequest extends PushRequest {
return service.moveGtask(super.listId, taskId, parentId, priorSiblingId);
}
@Override
protected void recover() {
parentId = null;
priorSiblingId = null;
}
public String getParentId() {
return parentId;
}

@ -41,5 +41,16 @@ public abstract class PushRequest {
this.service = service;
}
public abstract Task executePush() throws IOException;
public Task push() throws IOException {
try {
return executePush();
} catch (IOException e) {
recover();
return executePush();
}
}
protected abstract Task executePush() throws IOException;
protected abstract void recover();
}

@ -20,4 +20,9 @@ public class UpdateRequest extends PushRequest {
return service.updateGtask(listId, toPush);
}
@Override
protected void recover() {
//Figure out a good way to recover!
}
}

@ -292,7 +292,7 @@ public final class GtasksSyncOnSaveService {
}
MoveRequest move = new MoveRequest(gtasksService, taskId, listId, parent, priorSibling);
move.executePush();
move.push();
}
private boolean syncOnSaveEnabled() {

@ -294,7 +294,7 @@ public class GtasksSyncProvider extends SyncProvider<GtasksTaskContainer> {
String remoteSibling = gtasksMetadataService.getRemoteSiblingId(listId, t.gtaskMetadata);
MoveRequest move = new MoveRequest(taskService, toMove, listId, remoteParent, remoteSibling);
move.executePush();
move.push();
}
}
@ -435,7 +435,7 @@ public class GtasksSyncProvider extends SyncProvider<GtasksTaskContainer> {
CreateRequest createRequest = new CreateRequest(taskService, listId, createdTask, local.parentId, local.priorSiblingId);
//updateTaskHelper(local, null, createRequest);
localPropertiesToModel(local, null, createRequest.getToPush());
com.google.api.services.tasks.model.Task createResult = createRequest.executePush();
com.google.api.services.tasks.model.Task createResult = createRequest.push();
createdWithoutId.add(local);
createdWithoutOrder.add(local);
String newIdTask = createResult.getId();
@ -499,11 +499,11 @@ public class GtasksSyncProvider extends SyncProvider<GtasksTaskContainer> {
Log.e("gtasks-debug", "ACTION: move(1) - " + newIdTask + ", " + local.parentId + ", " + local.priorSiblingId);
//This case basically defaults to whatever local settings are. Future versions could try and merge better
MoveRequest moveRequest = new MoveRequest(taskService, newIdTask, idList, local.parentId, local.priorSiblingId);
moveRequest.executePush();
moveRequest.push();
}
if (request instanceof UpdateRequest) {
request.executePush();
request.push();
}
//Strategy--delete, migrate properties, recreate, update local AND remote ids; happens in MoveListRequest
@ -513,7 +513,7 @@ public class GtasksSyncProvider extends SyncProvider<GtasksTaskContainer> {
Log.e("gtasks-debug", "ACTION: moveTask(5), " + newIdTask + ", " + idList + " to " +
remote.gtaskMetadata.getValue(GtasksMetadata.LIST_ID));
MoveListRequest moveList = new MoveListRequest(taskService, newIdTask, remote.gtaskMetadata.getValue(GtasksMetadata.LIST_ID), idList, null);
com.google.api.services.tasks.model.Task result = moveList.executePush();
com.google.api.services.tasks.model.Task result = moveList.push();
local.gtaskMetadata.setValue(GtasksMetadata.ID, result.getId());
remote.gtaskMetadata.setValue(GtasksMetadata.ID, result.getId());
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

@ -467,9 +467,13 @@ public class FilterListActivity extends ExpandableListActivity {
} catch (IOException e) {
if (manual)
exceptionService.displayAndReportError(FilterListActivity.this, "refresh-tags-io", e);
else
exceptionService.reportError("refresh-tags-io", e);
} catch (JSONException e) {
if (manual)
exceptionService.displayAndReportError(FilterListActivity.this, "refresh-tags-json", e);
else
exceptionService.reportError("refresh-tags-io", e);
} finally {
if (manual)
DialogUtilities.dismissDialog(FilterListActivity.this, progressDialog);

@ -34,6 +34,7 @@ import android.content.IntentFilter;
import android.content.res.Resources;
import android.os.Bundle;
import android.speech.RecognizerIntent;
import android.text.TextUtils;
import android.text.format.DateUtils;
import android.util.Log;
import android.view.KeyEvent;
@ -432,6 +433,7 @@ public final class TaskEditActivity extends TabActivity {
database.openForReading();
if(idParam > -1L) {
model = taskService.fetchById(idParam, Task.PROPERTIES);
model.clearValue(Task.REMOTE_ID); // Having this can screw up autosync
}
// not found by id or was never passed an id
@ -506,9 +508,11 @@ public final class TaskEditActivity extends TabActivity {
if(!onPause && peopleControlSet != null && !peopleControlSet.saveSharingSettings(processedToast))
return;
if (!onPause) // Saving during on pause could cause a double finish
if (!onPause) { // Saving during on pause could cause a double finish
shouldSaveState = false;
finish();
}
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
@ -599,7 +603,7 @@ public final class TaskEditActivity extends TabActivity {
shouldSaveState = false;
// abandon editing in this case
if(title.getText().length() == 0) {
if(title.getText().length() == 0 || TextUtils.isEmpty(model.getValue(Task.TITLE))) {
if(isNewTask)
taskService.delete(model);
}

@ -169,7 +169,6 @@ public class TaskDao extends DatabaseDao<Task> {
*/
public boolean save(Task task) {
boolean saveSuccessful;
if (task.getId() == Task.NO_ID) {
saveSuccessful = createNew(task);
} else {

@ -33,7 +33,6 @@ import com.todoroo.astrid.gtasks.GtasksPreferenceService;
import com.todoroo.astrid.notes.NoteMetadata;
import com.todoroo.astrid.producteev.sync.ProducteevDataService;
import com.todoroo.astrid.service.abtesting.ABChooser;
import com.todoroo.astrid.service.abtesting.ABOptions;
import com.todoroo.astrid.tags.TagCaseMigrator;
import com.todoroo.astrid.utility.AstridPreferences;
@ -114,9 +113,6 @@ public final class UpgradeService {
Preferences.setInt(AstridPreferences.P_UPGRADE_FROM, from);
if (from <= V3_8_3_1) // This needs to happen synchronously
abChooser.setChoiceForOption(ABOptions.AB_OPTION_FIRST_ACTIVITY, 0);
new Thread(new Runnable() {
@Override
public void run() {

@ -4,8 +4,6 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import com.todoroo.astrid.service.StatisticsConstants;
/**
* Helper class to define options with their probabilities and descriptions
* @author Sam Bosley <sam@astrid.com>
@ -168,29 +166,7 @@ public class ABOptions {
}
private void initialize() { // Set up
addOption(AB_OPTION_FIRST_ACTIVITY, AB_OPTION_FIRST_ACTIVITY_PROBS,
AB_OPTION_FIRST_ACTIVITY_DESCRIPTIONS, AB_OPTION_FIRST_ACTIVITY_RELEVANT_EVENTS);
addOption(AB_OPTION_WELCOME_LOGIN, AB_OPTION_WELCOME_LOGIN_PROBS,
AB_OPTION_WELCOME_LOGIN_DESCRIPTIONS, AB_OPTION_WELCOME_LOGIN_RELEVANT_EVENTS);
}
public static final String AB_OPTION_FIRST_ACTIVITY = "ab_first_activity";
private static final int[] AB_OPTION_FIRST_ACTIVITY_PROBS = { 9, 1 };
private static final String[] AB_OPTION_FIRST_ACTIVITY_DESCRIPTIONS = { "ab-show-tasks-first", "ab-show-lists-first" };
private static final String[] AB_OPTION_FIRST_ACTIVITY_RELEVANT_EVENTS = { StatisticsConstants.CREATE_TASK,
StatisticsConstants.TASK_CREATED_TASKLIST,
StatisticsConstants.USER_FIRST_TASK,
StatisticsConstants.ACTFM_LIST_SHARED,
StatisticsConstants.ACTFM_NEW_USER };//*/
public static final String AB_OPTION_WELCOME_LOGIN = "ab_welcome_login";
private static final int[] AB_OPTION_WELCOME_LOGIN_PROBS = { 9, 1 };
private static final String[] AB_OPTION_WELCOME_LOGIN_DESCRIPTIONS = { "ab-welcome-login-show", "ab-welcome-login-skip" };
private static final String[] AB_OPTION_WELCOME_LOGIN_RELEVANT_EVENTS = { StatisticsConstants.CREATE_TASK,
StatisticsConstants.TASK_CREATED_TASKLIST,
StatisticsConstants.USER_FIRST_TASK,
StatisticsConstants.ACTFM_LIST_SHARED,
StatisticsConstants.ACTFM_NEW_USER };//*/
//Calls to addOption go here
}
}

@ -9,13 +9,11 @@ import com.timsu.astrid.R;
import com.todoroo.andlib.service.Autowired;
import com.todoroo.andlib.service.ContextManager;
import com.todoroo.andlib.service.DependencyInjectionService;
import com.todoroo.astrid.activity.FilterListActivity;
import com.todoroo.astrid.activity.TaskListActivity;
import com.todoroo.astrid.service.AstridDependencyInjector;
import com.todoroo.astrid.service.StartupService;
import com.todoroo.astrid.service.StatisticsService;
import com.todoroo.astrid.service.abtesting.ABChooser;
import com.todoroo.astrid.service.abtesting.ABOptions;
import com.todoroo.astrid.utility.AstridPreferences;
public class SplashScreenLauncher extends Activity {
@ -43,46 +41,22 @@ public class SplashScreenLauncher extends Activity {
private void finishAndShowNext(boolean isNewUser) {
if (isNewUser) {
int welcomeLoginChoice = abChooser.getChoiceForOption(ABOptions.AB_OPTION_WELCOME_LOGIN);
welcomeLoginPath(welcomeLoginChoice);
welcomeLoginPath();
} else {
int tasksOrListsChoice = abChooser.getChoiceForOption(ABOptions.AB_OPTION_FIRST_ACTIVITY);
mainActivityPath(tasksOrListsChoice);
mainActivityPath();
}
}
private void welcomeLoginPath(int welcomeLoginChoice) {
private void welcomeLoginPath() {
Intent intent = new Intent();
switch(welcomeLoginChoice) {
case 0: // Show welcome login, then welcome screen
intent.setClass(this, WelcomeLogin.class);
break;
case 1: // Go straight to welcome screen
intent.setClass(this, WelcomeGraphic.class);
intent.putExtra(WelcomeGraphic.KEY_SHOW_EULA, true);
break;
default:
intent.setClass(this, WelcomeLogin.class);
break;
}
startActivity(intent);
finish();
}
private void mainActivityPath(int tasksOrListsChoice) {
private void mainActivityPath() {
Intent intent = new Intent();
switch (tasksOrListsChoice) {
case 0:
intent.setClass(this, TaskListActivity.class); // Go to task list activity
break;
case 1:
intent.setClass(this, FilterListActivity.class); // Go to filter list activity
intent.putExtra(FilterListActivity.SHOW_BACK_BUTTON, false);
break;
default:
intent.setClass(this, TaskListActivity.class);
break;
}
startActivity(intent);
finish();
}

@ -15,12 +15,10 @@ import com.todoroo.andlib.service.DependencyInjectionService;
import com.todoroo.andlib.utility.AndroidUtilities;
import com.todoroo.astrid.actfm.sync.ActFmSyncProvider;
import com.todoroo.astrid.activity.Eula;
import com.todoroo.astrid.activity.FilterListActivity;
import com.todoroo.astrid.activity.TaskListActivity;
import com.todoroo.astrid.service.StartupService;
import com.todoroo.astrid.service.StatisticsService;
import com.todoroo.astrid.service.abtesting.ABChooser;
import com.todoroo.astrid.service.abtesting.ABOptions;
public class WelcomeGraphic extends Activity {
@ -99,18 +97,7 @@ public class WelcomeGraphic extends Activity {
private Intent getNextIntent() {
Intent intent = new Intent();
int choice = abChooser.getChoiceForOption(ABOptions.AB_OPTION_FIRST_ACTIVITY);
switch (choice) {
case 0:
intent.setClass(this, TaskListActivity.class);
break;
case 1:
intent.setClass(this, FilterListActivity.class);
intent.putExtra(FilterListActivity.SHOW_BACK_BUTTON, false);
break;
default:
intent.setClass(this, TaskListActivity.class);
}
return intent;
}
}

Loading…
Cancel
Save