Skip to content

Commit

Permalink
preferences is stored as string
Browse files Browse the repository at this point in the history
  • Loading branch information
ruleant committed Apr 6, 2014
1 parent 049e233 commit 4d2211e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/java/com/github/ruleant/getback_gps/SettingsActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ public class SettingsActivity extends PreferenceActivity {
public static final int GEO_ORIENTATION_SENSOR_CALCULATED = 2;

/**
* Default value of preference Default geo orientation sensor.
* Default value of preference Default geo orientation sensor :
* raw sensors.
*/
public static final int DEFAULT_PREF_GEO_ORIENTATION_SENSOR
= GEO_ORIENTATION_SENSOR_RAW;
public static final String DEFAULT_PREF_GEO_ORIENTATION_SENSOR = "1";

/**
* 60 seconds.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,11 @@ public final void registerEvents(final SensorEventListener listener) {
return;
}

int sensor = PreferenceManager.getDefaultSharedPreferences(mContext)
.getInt(
int sensor = Integer.parseInt(
PreferenceManager.getDefaultSharedPreferences(mContext)
.getString(
SettingsActivity.KEY_PREF_GEO_ORIENTATION_SENSOR,
SettingsActivity.DEFAULT_PREF_GEO_ORIENTATION_SENSOR);
SettingsActivity.DEFAULT_PREF_GEO_ORIENTATION_SENSOR));

if (sensor == SettingsActivity.GEO_ORIENTATION_SENSOR_CALCULATED
&& mOrientationSensor != null) {
Expand Down

0 comments on commit 4d2211e

Please sign in to comment.