Buggy code:
@ Override public void onActivityResult ( int requestCode , int resultCode , Intent data ) { } public void onScroll ( AbsListView view , int firstVisibleItem , int visibleItemCount , int totalItemCount ) { } public void onScrollStateChanged ( AbsListView view , int scrollState ) { } public void loadTaskListContent ( boolean requery ) { } protected void setUpTaskList ( ) { } @ SuppressWarnings ( "nls" ) private void selectCustomId ( long withCustomId ) { } private void showTaskCreateHelpPopover ( ) { } private void showTaskEditHelpPopover ( ) { } private void showListsHelp ( ) { } protected void onTaskCompleted ( Task item ) { } @ SuppressWarnings ( "nls" ) protected Task quickAddTask ( String title , boolean selectNewTask ) { } public static Task createWithValues ( ContentValues values , String title , TaskService taskService , MetadataService metadataService ) { } protected void handleCommentsButtonClicked ( ) { } private static void showAlertForMarkupTask ( AstridActivity activity , Task task , String originalText ) { } @ Override public void onCreateContextMenu ( ContextMenu menu , View v , ContextMenuInfo menuInfo ) { } public boolean isFilter ( ) { } private void deleteTask ( final Task task ) { } protected static class IntentWithLabel extends Intent { private final String label ; public IntentWithLabel ( Intent in , String labelIn ) { } @ Override public String toString ( ) { } } private static final String PREF_LAST_AUTO_SYNC = "taskListLastAutoSync" ; protected void initiateAutomaticSync ( ) { } protected void performSyncServiceV2Sync ( boolean manual ) { } protected void performSyncAction ( ) { } private < TYPE > void showSyncOptionMenu ( TYPE [ ] items , DialogInterface . OnClickListener listener ) { } @ Override public void onListItemClick ( ListView l , View v , int position , long id ) { } @ Override public boolean onContextItemSelected ( MenuItem item ) { } @ Override public boolean onOptionsItemSelected ( final MenuItem item ) { Intent intent ; long itemId ; switch ( item . getItemId ( ) ) { case TaskListFragment . MENU_ADDONS_ID : StatisticsService . reportEvent ( TLA_MENU_ADDONS ) ; intent = new Intent ( getActivity ( ) , AddOnActivity . class ) ; startActivityForResult ( intent , TaskListFragment . ACTIVITY_ADDONS ) ; return true ; case TaskListFragment . MENU_SETTINGS_ID : showSettings ( ) ; return true ; case TaskListFragment . MENU_SORT_ID : StatisticsService . reportEvent ( TLA_MENU_SORT ) ; AlertDialog dialog = SortSelectionActivity . createDialog ( getActivity ( ) , this , sortFlags , sortSort ) ; dialog . show ( ) ; return true ; case TaskListFragment . MENU_SYNC_ID : StatisticsService . reportEvent ( TLA_MENU_SYNC ) ; performSyncAction ( ) ; return true ; case TaskListFragment . MENU_SUPPORT_ID : showSupport ( ) ; return true ; case TaskListFragment . MENU_ADDON_INTENT_ID : intent = item . getIntent ( ) ; AndroidUtilities . startExternalIntent ( getActivity ( ) , intent , TaskListFragment . ACTIVITY_MENU_EXTERNAL ) ; return true ; case TaskListFragment . CONTEXT_MENU_BROADCAST_INTENT_ID : { intent = item . getIntent ( ) ; getActivity ( ) . sendBroadcast ( intent ) ; return true ; } case TaskListFragment . CONTEXT_MENU_EDIT_TASK_ID : { itemId = item . getGroupId ( ) ; mListener . onTaskListItemClicked ( itemId ) ; return true ; } case TaskListFragment . CONTEXT_MENU_COPY_TASK_ID : { itemId = item . getGroupId ( ) ; Task original = new Task ( ) ; original . setId ( itemId ) ; Flags . set ( ACTFM_SUPPRESS_SYNC ) ; Flags . set ( GTASKS_SUPPRESS_SYNC ) ; Task clone = taskService . clone ( original ) ; clone . setValue ( CREATION_DATE , DateUtilities . now ( ) ) ; clone . setValue ( COMPLETION_DATE , 0L ) ; clone . setValue ( DELETION_DATE , 0L ) ; clone . setValue ( CALENDAR_URI , "" ) ; GCalHelper . createTaskEventIfEnabled ( clone ) ; taskService . save ( clone ) ; intent = new Intent ( getActivity ( ) , TaskEditActivity . class ) ; intent . putExtra ( TOKEN_ID , clone . getId ( ) ) ; intent . putExtra ( TaskListFragment . TOKEN_FILTER , filter ) ; <START_BUG> startActivityForResult ( intent , TaskListFragment . ACTIVITY_EDIT_TASK ) ; <END_BUG> transitionForTaskEdit ( ) ; return true ; } case TaskListFragment . CONTEXT_MENU_DELETE_TASK_ID : { itemId = item . getGroupId ( ) ; Task task = new Task ( ) ; task . setId ( itemId ) ; deleteTask ( task ) ; return true ; } case TaskListFragment . CONTEXT_MENU_UNDELETE_TASK_ID : { itemId = item . getGroupId ( ) ; Task task = new Task ( ) ; task . setId ( itemId ) ; task . setValue ( DELETION_DATE , 0L ) ; taskService . save ( task ) ; loadTaskListContent ( true ) ; return true ; } case TaskListFragment . CONTEXT_MENU_PURGE_TASK_ID : { itemId = item . getGroupId ( ) ; taskService . purge ( itemId ) ; loadTaskListContent ( true ) ; return true ; } default : { if ( ( item . getItemId ( ) ) < ( TaskListFragment . CONTEXT_MENU_PLUGIN_ID_FIRST ) ) return false ; if ( ( ( item . getItemId ( ) ) - ( TaskListFragment . CONTEXT_MENU_PLUGIN_ID_FIRST ) ) >= ( contextItemExposers . length ) ) return false ; AdapterContextMenuInfo adapterInfo = ( ( AdapterContextMenuInfo ) ( item . getMenuInfo ( ) ) ) ; Task task = ( ( ViewHolder ) ( adapterInfo . targetView . getTag ( ) ) ) . task ; contextItemExposers [ ( ( item . getItemId ( ) ) - ( TaskListFragment . CONTEXT_MENU_PLUGIN_ID_FIRST ) ) ] . invoke ( task ) ; return true ; } } } public void showSupport ( ) { } public void showSettings ( ) { } public void onTaskListItemClicked ( long taskId ) { } @ SuppressWarnings ( "nls" ) @ Override public void gesturePerformed ( String gesture ) { } @ Override public void onSortSelected ( boolean always , int flags , int sort ) { }

Fix:
getActivity ( ) . startActivityForResult ( intent , TaskListFragment . ACTIVITY_EDIT_TASK ) ;