Search in sources :

Example 1 with QueryThreadsHandler

use of ingage.ingage.handlers.QueryThreadsHandler in project iNGAGE by davis123123.

the class CategoriesPageFragment method getThreadsJSON.

public void getThreadsJSON(int rowCount) {
    queryThreadsHandler = new QueryThreadsHandler();
    session = new SessionManager(getActivity().getApplicationContext());
    HashMap<String, String> user = session.getUserDetails();
    String type = user.get(SessionManager.PAGE_TYPE);
    String categoryType = user.get(SessionManager.CATEGORY_TYPE);
    try {
        if (categoryType != null)
            json_string = queryThreadsHandler.execute("categoryDate", categoryType, String.valueOf(rowCount)).get();
        else
            json_string = queryThreadsHandler.execute("date", String.valueOf(rowCount)).get();
        Log.d("STATE", "query result : " + json_string);
        threadListAdapter.setLoaded(false);
    } catch (InterruptedException e) {
        e.printStackTrace();
    } catch (ExecutionException e) {
        e.printStackTrace();
    }
}
Also used : SessionManager(ingage.ingage.managers.SessionManager) QueryThreadsHandler(ingage.ingage.handlers.QueryThreadsHandler) ExecutionException(java.util.concurrent.ExecutionException)

Example 2 with QueryThreadsHandler

use of ingage.ingage.handlers.QueryThreadsHandler in project iNGAGE by davis123123.

the class ArchivedFragment method getThreadsJSON.

public void getThreadsJSON(int rowCount) {
    queryThreadsHandler = new QueryThreadsHandler();
    SessionManager session = new SessionManager(getActivity().getApplicationContext());
    HashMap<String, String> user = session.getUserDetails();
    String test = user.get(SessionManager.CATEGORY_TYPE);
    Log.d("ARCCATE", " " + test + " " + rowCount);
    try {
        if (user.get(SessionManager.CATEGORY_TYPE) != null) {
            json_string = queryThreadsHandler.execute("categoryArchived", user.get(SessionManager.CATEGORY_TYPE), String.valueOf(rowCount)).get();
            Log.d("ARCCATE2", " " + json_string);
        } else {
            json_string = queryThreadsHandler.execute("archived", String.valueOf(rowCount)).get();
        }
        Log.d("STATE", "query result : " + json_string);
        threadListAdapter.setLoaded(false);
    } catch (InterruptedException e) {
        e.printStackTrace();
    } catch (ExecutionException e) {
        e.printStackTrace();
    }
}
Also used : SessionManager(ingage.ingage.managers.SessionManager) QueryThreadsHandler(ingage.ingage.handlers.QueryThreadsHandler) ExecutionException(java.util.concurrent.ExecutionException)

Aggregations

QueryThreadsHandler (ingage.ingage.handlers.QueryThreadsHandler)2 SessionManager (ingage.ingage.managers.SessionManager)2 ExecutionException (java.util.concurrent.ExecutionException)2