コード例 #1
0
 @Override
 public void editQuestion(long questionId) {
   if (mTwoPane) {
     QuestionManagerFragment fragment = new QuestionManagerFragment();
     Bundle args = new Bundle();
     args.putLong(QuestionManagerFragment.QUESTION_ID, questionId);
     fragment.setArguments(args);
     getSupportFragmentManager()
         .beginTransaction()
         .replace(R.id.question_detail_container, fragment)
         .commit();
   } else {
     Intent detailIntent = new Intent(this, QuestionManagerDetailActivity.class);
     detailIntent.putExtra(QuestionManagerFragment.QUESTION_ID, questionId);
     startActivity(detailIntent);
   }
 }
コード例 #2
0
 @Override
 public void onPositiveConfirmation(Object onPositivArgument) {
   if (onPositivArgument instanceof Long) {
     Long questionId = (Long) onPositivArgument;
     questionQuery.delete(questionId);
     answerQuery.deleteAllAnswersAsociated2Question(questionId);
     if (mTwoPane) {
       QuestionManagerListFragment listFragment =
           (QuestionManagerListFragment)
               getSupportFragmentManager().findFragmentById(R.id.question_list);
       QuestionManagerFragment managerFragment =
           (QuestionManagerFragment)
               getSupportFragmentManager().findFragmentById(R.id.question_detail_container);
       managerFragment.clearDialog();
       listFragment.updateQuestionList();
     }
   }
 }