Commit f1ec9633 by Kim Jinsung

プッシュメッセージからチャット・協業開く時に毎回Activity作成する問題対応

チャット画面が表示中には新しくActivity作成するのではなく、その画面をリロードする処理
parent 6ffc5bed
......@@ -161,15 +161,20 @@ public class ShowPushMessageDailogActivity extends ABVUIActivity {
String collaborationType = extras.getString(AppDefType.ChatPushMessageKey.collaborationType);
String roomType = extras.getString(AppDefType.ChatPushMessageKey.roomType);
if (roomId > 0 && !StringUtil.isNullOrEmpty(roomName)) {
if (StringUtil.isNullOrEmpty(collaborationType)) {
ActivityHandlingHelper.getInstance().startChatWebViewActivity(roomId, roomName, ChatWebViewActivity.class.getName(),"");
ChatWebViewActivity chatWebViewActivity= activityHandlingHelper.getChatWebViewActivity();
if (chatWebViewActivity != null) {
chatWebViewActivity.reloadRoomViewCollaboration(roomId, roomName, collaborationType);
} else {
ActivityHandlingHelper.getInstance().startChatWebViewActivityWithCollaboration(roomId,
roomName,
collaborationType,
roomType,
ChatWebViewActivity.class.getName(),
"");
if (StringUtil.isNullOrEmpty(collaborationType)) {
ActivityHandlingHelper.getInstance().startChatWebViewActivity(roomId, roomName, ChatWebViewActivity.class.getName(),"");
} else {
ActivityHandlingHelper.getInstance().startChatWebViewActivityWithCollaboration(roomId,
roomName,
collaborationType,
roomType,
ChatWebViewActivity.class.getName(),
"");
}
}
}
}
......
......@@ -1391,4 +1391,17 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
// 最後のチャットのルーム
PreferenceUtil.putUserPref(getApplicationContext(), AppDefType.UserPrefKey.CHAT_LAST_ROOMID, roomId);
}
/**
* プッシュメッセージ受信し、既にChatWebViewActivityが表示中の時、WebViewリロードする。
* @param roomId ルームID
* @param roomName ルーム名
* @param collaborationType 協業タイプ
*/
public void reloadRoomViewCollaboration(Long roomId, String roomName, String collaborationType) {
chatData.roomId = roomId;
chatData.roomName = roomName;
chatData.setStrCollaborationType(collaborationType);
registChatRoomPageLoader();
}
}
......@@ -1885,6 +1885,20 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
}
/**
* 使用中のChatWebViewActivityを返す
* @return 使用中のChatWebViewActivity
*/
public ChatWebViewActivity getChatWebViewActivity() {
if (!currentActivityStack.isEmpty()) {
for (final ABVAuthenticatedActivity activity : currentActivityStack) {
if (activity instanceof ChatWebViewActivity) {
return (ChatWebViewActivity)activity;
}
}
}
return null;
}
/**
* 設定画面から戻る用
* @return 設定画面へ遷移前の画面
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment