Skip to content

Commit

Permalink
Merge branches 'issue140' and 'issue142'
Browse files Browse the repository at this point in the history
  • Loading branch information
blinskey committed Aug 15, 2015
2 parents bf85432 + 6861459 commit 4a78cb0
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package com.benlinskey.greekreference.views.detail.lexicon;

import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
Expand All @@ -28,6 +29,7 @@
import android.net.NetworkInfo;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v4.app.FragmentActivity;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
Expand Down Expand Up @@ -60,13 +62,19 @@ public class LexiconDetailFragment extends AbstractDetailFragment {

private LexiconEntry mLexiconEntry = null;
private boolean mBlank = true; // True if no entry displayed.
private FragmentActivity mActivity = null;

/**
* Mandatory empty constructor for the fragment manager to instantiate the
* fragment (e.g. upon screen orientation changes).
*/
public LexiconDetailFragment() {}

public void onAttach(Activity activity) {
super.onAttach(activity);
mActivity = (FragmentActivity) activity;
}

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Expand Down Expand Up @@ -128,7 +136,7 @@ public void onPrepareOptionsMenu(Menu menu) {
* otherwise
*/
private boolean perseusToolOptionDisabled() {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getActivity());
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(mActivity);
return prefs.getBoolean(getString(R.string.pref_perseus_tool_key), false);
}

Expand Down

0 comments on commit 4a78cb0

Please sign in to comment.