Ejemplo n.º 1
0
 @Override
 public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setRetainInstance(true);
   mContext = getActivity();
   dbhandler = DatabaseHandler.getInstance(mContext);
   savedInstanceState = getArguments();
   if (savedInstanceState != null
       && savedInstanceState.getString("PREFERENCE_SCREEN_KEY") != null) {
     savedInstanceState.remove("PREFERENCE_SCREEN_KEY");
     addPreferencesFromResource(R.xml.pref_year);
     mTitle = getString(R.string.year);
   } else {
     addPreferencesFromResource(R.xml.pref_settings);
     PreferenceScreen preferencescreen = getPreferenceScreen();
     mPush = (CheckBoxPreference) preferencescreen.findPreference("pref_push");
     mYear = preferencescreen.findPreference("pref_year");
     appVersion = preferencescreen.findPreference("appVersion");
     bugReport = preferencescreen.findPreference("bugReport");
     jonny = preferencescreen.findPreference("jonny");
     mTitle = getString(R.string.settings);
     setPrefs();
     setStaticPrefs();
   }
 }
Ejemplo n.º 2
0
 @Override
 public void onDestroyView() {
   mActivity.mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_UNLOCKED);
   mActivity.getDelegate().getSupportActionBar().setDisplayHomeAsUpEnabled(false);
   mActivity.getDelegate().getSupportActionBar().setDisplayShowTitleEnabled(true);
   mActivity.mDrawerToggle.setDrawerIndicatorEnabled(true);
   super.onDestroyView();
 }
  @Override
  public void onActivityResult(int reqCode, int resultCode, Intent data) {
    super.onActivityResult(reqCode, resultCode, data);

    Log.w(TAG, "Got result: " + resultCode + " for req: " + reqCode);
    if (resultCode == Activity.RESULT_OK && reqCode == PICK_IDENTITY_CONTACT) {
      handleIdentitySelection(data);
    }
  }
  @Override
  public void onResume() {
    super.onResume();
    ((ApplicationPreferencesActivity) getActivity())
        .getSupportActionBar()
        .setTitle(R.string.preferences__advanced);

    initializePushMessagingToggle();
  }
  @Override
  public void onCreate(Bundle paramBundle) {
    super.onCreate(paramBundle);
    masterSecret = getArguments().getParcelable("master_secret");
    addPreferencesFromResource(R.xml.preferences_advanced);

    initializeIdentitySelection();

    Preference submitDebugLog = this.findPreference(SUBMIT_DEBUG_LOG_PREF);
    submitDebugLog.setOnPreferenceClickListener(new SubmitDebugLogListener());
    submitDebugLog.setSummary(getVersion(getActivity()));
  }
Ejemplo n.º 6
0
 public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) {
   super.onPreferenceTreeClick(preferenceScreen, preference);
   if (preference == mYear) {
     SettingsFragment settingsFragment = new SettingsFragment();
     Bundle args = new Bundle();
     args.putString("PREFERENCE_SCREEN_KEY", "pref_year");
     settingsFragment.setArguments(args);
     getActivity()
         .getSupportFragmentManager()
         .beginTransaction()
         .setCustomAnimations(R.anim.push_up_in, 0, 0, R.anim.push_down_out)
         .replace(R.id.fragment_container, settingsFragment, "SETTINGS_FRAGMENT_YEAR")
         .addToBackStack(null)
         .commit();
   }
   return false;
 }
Ejemplo n.º 7
0
 @Override
 public void onPause() {
   super.onPause();
   getPreferenceManager().getSharedPreferences().unregisterOnSharedPreferenceChangeListener(this);
 }
 @Override
 public void onStart() {
   super.onStart();
   MainSettingsActivity.setActivityTitle(this, getString(R.string.next_word_dict_settings));
   loadUsageStatistics();
 }
 @Override
 public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
   super.onViewCreated(view, savedInstanceState);
   findPreference("clear_next_word_data").setOnPreferenceClickListener(mClearDataListener);
 }
 @Override
 public void onCreate(Bundle paramBundle) {
   super.onCreate(paramBundle);
   addPreferencesFromResource(R.xml.prefs_next_word);
 }
 @Override
 public void onStop() {
   super.onStop();
   mNextWordStatsLoader.cancel(false);
 }