Search in sources :

Example 1 with SearchHandler

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

the class SearchResultArchivedFragment method getThreadsJSON.

public void getThreadsJSON(int rowCount, String searchString) {
    searchHandler = new SearchHandler();
    Log.d("ROWCOUNT", " result : " + searchString);
    String type = "archived";
    try {
        json_string = searchHandler.execute(type, String.valueOf(rowCount), searchString).get();
        Log.d("ARCHIVED", "query result : " + json_string);
        if (json_string.equals("No results"))
            Toast.makeText(getActivity(), "No search results", Toast.LENGTH_LONG).show();
        else {
            threadListAdapter.setLoaded(false);
            inflateThreads();
        }
    } catch (InterruptedException e) {
        e.printStackTrace();
    } catch (ExecutionException e) {
        e.printStackTrace();
    }
}
Also used : SearchHandler(ingage.ingage.handlers.SearchHandler) ExecutionException(java.util.concurrent.ExecutionException)

Example 2 with SearchHandler

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

the class SearchResultFragment method getThreadsJSON.

public void getThreadsJSON(int rowCount, String searchString) {
    searchHandler = new SearchHandler();
    Log.d("ROWCOUNT", " result : " + searchString);
    session = new SessionManager(getActivity().getApplicationContext());
    HashMap<String, String> user = session.getUserDetails();
    String type = "active";
    try {
        json_string = searchHandler.execute(type, String.valueOf(rowCount), searchString).get();
        Log.d("STATE", "query result : " + json_string);
        if (json_string.equals("No results"))
            Toast.makeText(getActivity(), "No search results", Toast.LENGTH_LONG).show();
        else {
            threadListAdapter.setLoaded(false);
            inflateThreads();
        }
    } catch (InterruptedException e) {
        e.printStackTrace();
    } catch (ExecutionException e) {
        e.printStackTrace();
    }
}
Also used : SearchHandler(ingage.ingage.handlers.SearchHandler) SessionManager(ingage.ingage.managers.SessionManager) ExecutionException(java.util.concurrent.ExecutionException)

Aggregations

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