Search in sources :

Example 26 with SessionManager

use of ingage.ingage20.managers.SessionManager in project iNGAGE by davis123123.

the class ChatActivity method onResume.

@Override
public void onResume() {
    super.onResume();
    Log.d("RESUMECHAT", "textRESUME ");
    HashMap<String, String> chat_user = chatRoomManager.getUserDetails();
    String spectator = chat_user.get(ChatRoomManager.SPECTATOR);
    // check from cache is user is spectator
    if (spectator.equals("true") && paused) {
        String type = "spectate";
        session = new SessionManager(getApplicationContext());
        HashMap<String, String> user = session.getUserDetails();
        String username = user.get(SessionManager.KEY_NAME);
        SpectateRoomHandler spectateRoomHandler = new SpectateRoomHandler(getApplicationContext());
        String result;
        setSpectateMode();
        try {
            result = spectateRoomHandler.execute(type, thread_id, username).get();
        } catch (InterruptedException | ExecutionException e) {
            e.printStackTrace();
        }
        paused = false;
    }
}
Also used : SpectateRoomHandler(ingage.ingage20.handlers.SpectateRoomHandler) SessionManager(ingage.ingage20.managers.SessionManager) ExecutionException(java.util.concurrent.ExecutionException)

Aggregations

SessionManager (ingage.ingage20.managers.SessionManager)26 ExecutionException (java.util.concurrent.ExecutionException)10 TextView (android.widget.TextView)7 View (android.view.View)6 ImageView (android.widget.ImageView)5 ChatRoomManager (ingage.ingage20.managers.ChatRoomManager)5 ChatRoomHandler (ingage.ingage20.handlers.ChatRoomHandler)4 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)3 RecyclerView (android.support.v7.widget.RecyclerView)3 Bundle (android.os.Bundle)2 ActionBar (android.support.v7.app.ActionBar)2 QueryThreadsHandler (ingage.ingage20.handlers.QueryThreadsHandler)2 SpectateRoomHandler (ingage.ingage20.handlers.SpectateRoomHandler)2 WifiManager (ingage.ingage20.managers.WifiManager)2 Context (android.content.Context)1 Intent (android.content.Intent)1 Fragment (android.support.v4.app.Fragment)1 LayoutInflater (android.view.LayoutInflater)1 AdapterView (android.widget.AdapterView)1 ListView (android.widget.ListView)1