Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cordova-plugin-local-notifications
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
Nabil Sadki
cordova-plugin-local-notifications
Commits
f873a096
Commit
f873a096
authored
Dec 11, 2013
by
Sebastián Katzer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
The application context needs to be set as first after reboot
parent
6e82355c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
Restore.java
src/android/Restore.java
+3
-2
No files found.
src/android/Restore.java
View file @
f873a096
...
@@ -40,6 +40,9 @@ public class Restore extends BroadcastReceiver {
...
@@ -40,6 +40,9 @@ public class Restore extends BroadcastReceiver {
@Override
@Override
public
void
onReceive
(
Context
context
,
Intent
intent
)
{
public
void
onReceive
(
Context
context
,
Intent
intent
)
{
// The application context needs to be set as first
LocalNotification
.
setContext
(
context
);
// Obtain alarm details form Shared Preferences
// Obtain alarm details form Shared Preferences
SharedPreferences
alarms
=
LocalNotification
.
getSharedPreferences
();
SharedPreferences
alarms
=
LocalNotification
.
getSharedPreferences
();
Set
<
String
>
alarmIds
=
alarms
.
getAll
().
keySet
();
Set
<
String
>
alarmIds
=
alarms
.
getAll
().
keySet
();
...
@@ -53,8 +56,6 @@ public class Restore extends BroadcastReceiver {
...
@@ -53,8 +56,6 @@ public class Restore extends BroadcastReceiver {
JSONArray
args
=
new
JSONArray
(
alarms
.
getString
(
alarmId
,
""
));
JSONArray
args
=
new
JSONArray
(
alarms
.
getString
(
alarmId
,
""
));
Options
options
=
new
Options
(
context
).
parse
(
args
.
getJSONObject
(
0
));
Options
options
=
new
Options
(
context
).
parse
(
args
.
getJSONObject
(
0
));
// The context got lost after reboot
LocalNotification
.
setContext
(
context
);
LocalNotification
.
add
(
options
);
LocalNotification
.
add
(
options
);
}
catch
(
JSONException
e
)
{}
}
catch
(
JSONException
e
)
{}
...
...
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