Commit 5a8176f6 authored by Adrien Dorsaz's avatar Adrien Dorsaz

Modifies ArticleListActivity to call SettingsActivity if needed.

parent 1ae817b5
......@@ -66,11 +66,20 @@ public class ArticleListActivity extends ListActivity {
getSharedPreferences(SettingsActivity.SHARED_PREFERENCES,
Activity.MODE_PRIVATE);
/* First, check if we need to ask settings to user. */
if (pref.getString(SettingsActivity.URL_SERVER_PREF, "").equals("")) {
Intent intent = new Intent(this, SettingsActivity.class);
startActivity(intent);
finish();
}
/* Then, get user preferences to know which articles to display. */
mDisplayChoice =
(ToDisplay) getIntent().getSerializableExtra(DISPLAYCHOICE_KEY);
if (mDisplayChoice == null) {
if (pref.getString(SettingsActivity.DISPLAY_BEHAVIOUR_PREF,
/* Now check if we should prompt user */
"ALWAYS_PROMPT").equals("ALWAYS_PROMPT")) {
Log.d("ArticleList",
"We display dialog box with mDisplayChoice : "
......@@ -166,8 +175,6 @@ public class ArticleListActivity extends ListActivity {
markAllRead();
break;
case R.id.menu_settings:
SettingsActivity.setWantToEdit();
Intent intent;
intent = new Intent(this, SettingsActivity.class);
startActivity(intent);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment