Tasks/src/tablet/java/com/dummies/tasks/tablet/activity/TaskListAndEditorActivity.java
@Override
    public void editTask(long id) {
        // Create the fragment for the given task id
        TaskEditFragment fragment = TaskEditFragment.newInstance(id);

        // Add the fragment to the activity. If there's one already
        // there (eg. the user clicks on another task), replace it
        FragmentTransaction ft = getFragmentManager()
                .beginTransaction();
        ft.replace(R.id.edit_container, fragment,
                TaskEditFragment.DEFAULT_FRAGMENT_TAG);

        // Add this change to the backstack, so that when the user
        // clicks the back button we'll pop this editor off the stack.
        // If we don't do this, the whole activity will close when the
        // user clicks the back button, which will be disruptive and
        // unexpected.
        ft.addToBackStack(null);

        // Make it so!
        ft.commit();
    }
/**
     * Called when the user asks to edit or insert a task.
     */
Called when the user asks to edit or insert a task.
Called when the user asks to edit or insert a task .
@Override
    public void editTask(long id) {
        TaskEditFragment fragment = TaskEditFragment.newInstance(id);
        FragmentTransaction ft = getFragmentManager()
                .beginTransaction();
        ft.replace(R.id.edit_container, fragment,
                TaskEditFragment.DEFAULT_FRAGMENT_TAG);
        ft.addToBackStack(null);
        ft.commit();
    }
@ Override public void editTask ( long id ) { TaskEditFragment fragment = TaskEditFragment . newInstance ( id ) ; FragmentTransaction ft = getFragmentManager ( ) . beginTransaction ( ) ; ft . replace ( R . id . edit_container , fragment , TaskEditFragment . DEFAULT_FRAGMENT_TAG ) ; ft . addToBackStack ( null ) ; ft . commit ( ) ; }
Called when the user asks to edit or insert a task.
Called when the user asks to edit or insert a task .
// Create the fragment for the given task id // Add the fragment to the activity. If there's one already // there (eg. the user clicks on another task), replace it // Add this change to the backstack, so that when the user // clicks the back button we'll pop this editor off the stack. // If we don't do this, the whole activity will close when the // user clicks the back button, which will be disruptive and // unexpected. // Make it so!