From b1183b5dfa6fcc077377f87d0c9ee3085684a790 Mon Sep 17 00:00:00 2001 From: lado Date: Mon, 7 Nov 2011 10:59:17 +0100 Subject: better locale setting --- .../src/de/bjusystems/vdrmanager/app/VdrManagerApp.java | 6 ------ .../src/de/bjusystems/vdrmanager/gui/BaseActivity.java | 14 ++++++++++++++ .../de/bjusystems/vdrmanager/gui/TimerListActivity.java | 1 + .../de/bjusystems/vdrmanager/gui/VdrManagerActivity.java | 3 ++- 4 files changed, 17 insertions(+), 7 deletions(-) (limited to 'vdrmanager') diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/app/VdrManagerApp.java b/vdrmanager/src/de/bjusystems/vdrmanager/app/VdrManagerApp.java index c04b55b..12620d2 100644 --- a/vdrmanager/src/de/bjusystems/vdrmanager/app/VdrManagerApp.java +++ b/vdrmanager/src/de/bjusystems/vdrmanager/app/VdrManagerApp.java @@ -56,7 +56,6 @@ public class VdrManagerApp extends Application { Preferences.init(this); } - public void clear() { this.currentEvent = null; this.currentTimer = null; @@ -72,11 +71,6 @@ public class VdrManagerApp extends Application { public void setCurrentEvent(final Event currentEvent) { this.currentEvent = currentEvent; - //if (currentEvent.getTimer() != null) { - //this.currentTimer = currentEvent.getTimer(); - //} else { - //this.currentTimer = new Timer(currentEvent); - //} } public Timer getCurrentTimer() { diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseActivity.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseActivity.java index 269ace9..412b4de 100644 --- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseActivity.java +++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseActivity.java @@ -4,6 +4,7 @@ import android.app.Activity; import android.app.AlertDialog; import android.content.Context; import android.net.ConnectivityManager; +import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import android.view.View; @@ -15,6 +16,7 @@ import android.widget.ViewFlipper; import de.bjusystems.vdrmanager.R; import de.bjusystems.vdrmanager.app.VdrManagerApp; import de.bjusystems.vdrmanager.data.Channel; +import de.bjusystems.vdrmanager.data.Preferences; import de.bjusystems.vdrmanager.utils.svdrp.SvdrpAsyncListener; import de.bjusystems.vdrmanager.utils.svdrp.SvdrpEvent; import de.bjusystems.vdrmanager.utils.svdrp.SvdrpException; @@ -58,6 +60,12 @@ public abstract class BaseActivity extends Activity } } + @Override + protected void onResume() { + Preferences.init(this); + super.onResume(); + } + protected void initFlipper() { this.flipper = (ViewFlipper) findViewById(R.id.flipper); retry = (Button) findViewById(R.id.retry_button); @@ -88,6 +96,12 @@ public abstract class BaseActivity extends Activity // setTitle(title); // } + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + Preferences.setLocale(this); + } + @Override public boolean onCreateOptionsMenu(final Menu menu) { MenuItem item; diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/TimerListActivity.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/TimerListActivity.java index 094e5be..a2037f2 100644 --- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/TimerListActivity.java +++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/TimerListActivity.java @@ -83,6 +83,7 @@ public class TimerListActivity extends BaseTimerEditActivity implements progress = new SvdrpProgressDialog(this, timerClient); // attach listener + task.addListener(progress); task.addListener(this); // start task diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/VdrManagerActivity.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/VdrManagerActivity.java index d3fbcb6..87f960e 100644 --- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/VdrManagerActivity.java +++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/VdrManagerActivity.java @@ -18,7 +18,8 @@ public class VdrManagerActivity extends Activity implements OnClickListener { @Override protected void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); - + + Preferences.setLocale(this); // attach view setContentView(R.layout.vdrmanager); -- cgit v1.2.3