2012-05-31 Santiago Munín <burnin1@gmail.com>
* src/pandroid_event_viewer/pandorafms/Main.java: Now, on MainActivity's restart, fetches groups and tags if url was changed. * src/pandroid_event_viewer/pandorafms/Options.java: Puts a boolean in SharedPreferences if url was changed. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6393 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
7d8cae5db3
commit
fd56b777ff
|
@ -1,3 +1,7 @@
|
|||
2012-05-31 Santiago Munín <burnin1@gmail.com>
|
||||
* src/pandroid_event_viewer/pandorafms/Main.java: Now, on MainActivity's restart, fetches groups and tags if url was changed.
|
||||
* src/pandroid_event_viewer/pandorafms/Options.java: Puts a boolean in SharedPreferences if url was changed.
|
||||
|
||||
2012-05-31 Santiago Munín <burnin1@gmail.com>
|
||||
* src/pandroid_event_viewer/pandorafms/Main.java: Added tag retrieving.
|
||||
* res/layout/main.xml: Added tags' spinner.
|
||||
|
|
|
@ -180,10 +180,16 @@ public class Main extends Activity {
|
|||
|
||||
public void onRestart() {
|
||||
super.onRestart();
|
||||
|
||||
if (this.pandoraGroups.size() == 0) {
|
||||
Log.i(TAG, "onRestart: getting groups");
|
||||
SharedPreferences preferences = getSharedPreferences(
|
||||
this.getString(R.string.const_string_preferences),
|
||||
Activity.MODE_PRIVATE);
|
||||
SharedPreferences.Editor editorPreferences = preferences.edit();
|
||||
if (preferences.getBoolean("url_changed", false)) {
|
||||
Log.i(TAG, "Getting groups and tags");
|
||||
new GetGroupsAsyncTask().execute();
|
||||
new GetTagsAsyncTask().execute();
|
||||
editorPreferences.putBoolean("url_changed", false);
|
||||
editorPreferences.commit();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -329,7 +335,7 @@ public class Main extends Activity {
|
|||
array.add(tags[1]);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// Log.e(TAG + ": getting tags", e.getMessage());
|
||||
Log.e(TAG, "getting tags problem");
|
||||
}
|
||||
|
||||
return array;
|
||||
|
|
|
@ -177,6 +177,8 @@ public class Options extends Activity {
|
|||
}
|
||||
|
||||
editorPreferences.putString("url", url);
|
||||
//MainActivity uses this to know if it has to check tags and groups again
|
||||
editorPreferences.putBoolean("url_changed", true);
|
||||
text = (EditText) findViewById(R.id.user);
|
||||
editorPreferences.putString("user", text.getText().toString());
|
||||
text = (EditText) findViewById(R.id.password);
|
||||
|
|
Loading…
Reference in New Issue