Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
InstiApp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
RAHUL SHARMA
InstiApp
Commits
2e90cead
Commit
2e90cead
authored
Jul 16, 2017
by
Sajal Narang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fetch fresh notifications before showing
parent
987407ef
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
app/src/main/java/in/ac/iitb/gymkhana/iitbapp/MainActivity.java
...c/main/java/in/ac/iitb/gymkhana/iitbapp/MainActivity.java
+6
-2
No files found.
app/src/main/java/in/ac/iitb/gymkhana/iitbapp/MainActivity.java
View file @
2e90cead
...
@@ -52,6 +52,7 @@ public class MainActivity extends AppCompatActivity
...
@@ -52,6 +52,7 @@ public class MainActivity extends AppCompatActivity
private
static
final
String
TAG
=
"MainActivity"
;
private
static
final
String
TAG
=
"MainActivity"
;
SessionManager
session
;
SessionManager
session
;
NotificationsResponse
notificationsResponse
;
NotificationsResponse
notificationsResponse
;
private
boolean
showNotifications
=
false
;
@Override
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
...
@@ -83,6 +84,10 @@ public class MainActivity extends AppCompatActivity
...
@@ -83,6 +84,10 @@ public class MainActivity extends AppCompatActivity
public
void
onResponse
(
Call
<
NotificationsResponse
>
call
,
Response
<
NotificationsResponse
>
response
)
{
public
void
onResponse
(
Call
<
NotificationsResponse
>
call
,
Response
<
NotificationsResponse
>
response
)
{
if
(
response
.
isSuccessful
())
{
if
(
response
.
isSuccessful
())
{
notificationsResponse
=
response
.
body
();
notificationsResponse
=
response
.
body
();
if
(
showNotifications
)
{
showNotifications
();
showNotifications
=
false
;
}
}
}
//Server Error
//Server Error
}
}
...
@@ -130,11 +135,10 @@ public class MainActivity extends AppCompatActivity
...
@@ -130,11 +135,10 @@ public class MainActivity extends AppCompatActivity
//noinspection SimplifiableIfStatement
//noinspection SimplifiableIfStatement
if
(
id
==
R
.
id
.
action_notifications
)
{
if
(
id
==
R
.
id
.
action_notifications
)
{
showNotifications
=
true
;
fetchNotifications
();
fetchNotifications
();
showNotifications
();
return
true
;
return
true
;
}
}
return
super
.
onOptionsItemSelected
(
item
);
return
super
.
onOptionsItemSelected
(
item
);
}
}
...
...
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