diff --git a/extras/pandroid_event_viewer/ChangeLog b/extras/pandroid_event_viewer/ChangeLog index 343507a99c..fcd7fa6882 100644 --- a/extras/pandroid_event_viewer/ChangeLog +++ b/extras/pandroid_event_viewer/ChangeLog @@ -1,3 +1,6 @@ +2012-06-24 Santiago Munín + * src/pandroid_event_viewer/pandorafms/Main.java: Removed getGroups function, now it calls API.getGroups(). + 2012-06-24 Santiago Munín * src/pandroid_event_viewer/pandorafms/Main.java: Added search profiles feature. * res/layout/main.xml: UI changes. Added search profiles feature. diff --git a/extras/pandroid_event_viewer/src/pandroid_event_viewer/pandorafms/Main.java b/extras/pandroid_event_viewer/src/pandroid_event_viewer/pandorafms/Main.java index 39e3b3095d..5b103cd7f4 100644 --- a/extras/pandroid_event_viewer/src/pandroid_event_viewer/pandorafms/Main.java +++ b/extras/pandroid_event_viewer/src/pandroid_event_viewer/pandorafms/Main.java @@ -24,9 +24,6 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; -import org.apache.http.NameValuePair; -import org.apache.http.message.BasicNameValuePair; - import android.app.Activity; import android.app.AlertDialog; import android.app.TabActivity; @@ -288,41 +285,6 @@ public class Main extends Activity { } } - /** - * Get groups through an api call. - * - * @return A list of groups. - */ - private List getGroups() { - ArrayList array = new ArrayList(); - - try { - List parameters = new ArrayList(); - parameters.add(new BasicNameValuePair("op", "get")); - parameters.add(new BasicNameValuePair("op2", "groups")); - parameters.add(new BasicNameValuePair("other_mode", - "url_encode_separator_|")); - parameters.add(new BasicNameValuePair("return_type", "csv")); - parameters.add(new BasicNameValuePair("other", ";")); - - String return_api = Core.httpGet(getApplicationContext(), - parameters); - String[] lines = return_api.split("\n"); - - for (int i = 0; i < lines.length; i++) { - String[] groups = lines[i].split(";", 21); - - this.pandoraGroups.put(Integer.valueOf(groups[0]), groups[1]); - - array.add(groups[1]); - } - } catch (Exception e) { - Log.e(TAG + ": getting groups", e.getMessage()); - } - - return array; - } - /** * Async task which get groups. * @@ -334,7 +296,8 @@ public class Main extends Activity { @Override protected Void doInBackground(Void... params) { - list = getGroups(); + list = new ArrayList(); + list.addAll(API.getGroups(getApplicationContext()).values()); return null; }