Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AloqaIM-Android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
AloqaIM-Android
Commits
b3b7629c
Commit
b3b7629c
authored
Apr 25, 2017
by
Nguyen Cong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move keepAliveServer back to onResume(), release subscription
parent
117d7489
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
2 deletions
+18
-2
AbstractAuthedActivity.java
.../chat/rocket/android/activity/AbstractAuthedActivity.java
+2
-1
MainActivity.java
.../main/java/chat/rocket/android/activity/MainActivity.java
+9
-1
MainPresenter.java
...main/java/chat/rocket/android/activity/MainPresenter.java
+7
-0
No files found.
app/src/main/java/chat/rocket/android/activity/AbstractAuthedActivity.java
View file @
b3b7629c
...
...
@@ -36,7 +36,6 @@ abstract class AbstractAuthedActivity extends AbstractFragmentActivity {
if
(
savedInstanceState
==
null
)
{
handleIntent
(
getIntent
());
}
ConnectivityManager
.
getInstance
(
getApplicationContext
()).
keepAliveServer
();
updateHostnameIfNeeded
(
rocketChatCache
.
getSelectedServerHostname
());
updateRoomIdIfNeeded
(
rocketChatCache
.
getSelectedRoomId
());
...
...
@@ -154,6 +153,8 @@ abstract class AbstractAuthedActivity extends AbstractFragmentActivity {
super
.
onResume
();
subscribeToConfigChanges
();
ConnectivityManager
.
getInstance
(
getApplicationContext
()).
keepAliveServer
();
}
@Override
...
...
app/src/main/java/chat/rocket/android/activity/MainActivity.java
View file @
b3b7629c
...
...
@@ -49,10 +49,18 @@ public class MainActivity extends AbstractAuthedActivity implements MainContract
setupSidebar
();
}
@Override
protected
void
onResume
()
{
super
.
onResume
();
if
(
presenter
!=
null
&&
presenter
instanceof
MainPresenter
)
{
((
MainPresenter
)
presenter
).
bindViewOnly
(
this
);
}
}
@Override
protected
void
onPause
()
{
if
(
presenter
!=
null
)
{
//
presenter.release();
presenter
.
release
();
}
super
.
onPause
();
...
...
app/src/main/java/chat/rocket/android/activity/MainPresenter.java
View file @
b3b7629c
...
...
@@ -44,6 +44,13 @@ public class MainPresenter extends BasePresenter<MainContract.View>
this
.
rocketChatCache
=
rocketChatCache
;
}
public
void
bindViewOnly
(
@NonNull
MainContract
.
View
view
)
{
super
.
bindView
(
view
);
subscribeToUnreadCount
();
subscribeToSession
();
setUserOnline
();
}
@Override
public
void
bindView
(
@NonNull
MainContract
.
View
view
)
{
super
.
bindView
(
view
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment