@Override
 public void onAttach(Activity activity) {
   super.onAttach(activity);
   try {
     fragmentListener = (FullFragmentListener) activity;
   } catch (ClassCastException ex) {
     ex.printStackTrace();
   }
 }
예제 #2
0
  private void initializeGameSettings() {

    // m_Random = new Random(1);
    m_Random = new Random(System.currentTimeMillis());

    try {
      mTimeToAnswerQuestion =
          Integer.parseInt(m_SharedPreferences.getString("editTextPreferenceCountDownTimer", "10"));
      mTimeToAnswerQuestion *= 1000;

    } catch (ClassCastException e) {
      mTimeToAnswerQuestion = 10000;
      Log.e(TAG, e.getMessage().toString());
    }
    try {
      mDelayBetweenQuestions =
          Integer.parseInt(
              m_SharedPreferences.getString("editTextPreferenceDelayBetweenQuestions", "500"));
    } catch (ClassCastException e) {
      Log.e(TAG, e.getMessage().toString());
    }
  }