package org.average.whereami;
+import org.average.whereami.WhereAmIprefs;
+
import android.app.Activity;
import android.net.wifi.WifiManager;
import android.os.Bundle;
import android.content.IntentFilter;
import android.content.Context;
import android.content.res.Resources;
+import android.content.SharedPreferences;
import android.text.format.Time;
import android.util.Log;
import android.view.View;
{
private WifiManager wifiman;
private Integer runningtasks = 0;
+ private SharedPreferences prefs;
private class UpdateTarget {
private TextView tv;
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
+ prefs = getSharedPreferences("WhereAmI", MODE_PRIVATE);
wifiman = (WifiManager)getSystemService(Context.WIFI_SERVICE);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
- //getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
- //getWindow().clearFlags(WindowManager.LayoutParams.
- // FLAG_FORCE_NOT_FULLSCREEN);
+ boolean fullscreen = prefs.getBoolean("fullscreen", false);
+ if (fullscreen) {
+ getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
+ getWindow().clearFlags(WindowManager.LayoutParams.
+ FLAG_FORCE_NOT_FULLSCREEN);
+ }
setContentView(R.layout.main);
res = getResources();
month = res.getStringArray(R.array.month);
return true;
case R.id.settings:
Log.w("WhereAmI", "settings requested");
+ startActivity(new Intent(this, WhereAmIprefs.class));
return true;
default:
return super.onOptionsItemSelected(item);
--- /dev/null
+package org.average.whereami;
+
+import android.os.Bundle;
+import android.preference.PreferenceActivity;
+
+public class WhereAmIprefs extends PreferenceActivity {
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ addPreferencesFromResource(R.xml.preferences);
+ }
+}