mirror of
https://github.com/MatomoCamp/matomocamp-companion-android.git
synced 2024-09-19 16:13:46 +02:00
Converted forgotten integer reference to Event id to long.
This commit is contained in:
parent
f72fd5966f
commit
4db8552e48
3 changed files with 6 additions and 6 deletions
|
@ -84,9 +84,9 @@ public class EventDetailsActivity extends ActionBarActivity implements LoaderCal
|
||||||
|
|
||||||
private static class EventLoader extends LocalCacheLoader<Event> {
|
private static class EventLoader extends LocalCacheLoader<Event> {
|
||||||
|
|
||||||
private final int eventId;
|
private final long eventId;
|
||||||
|
|
||||||
public EventLoader(Context context, int eventId) {
|
public EventLoader(Context context, long eventId) {
|
||||||
super(context);
|
super(context);
|
||||||
this.eventId = eventId;
|
this.eventId = eventId;
|
||||||
}
|
}
|
||||||
|
@ -99,7 +99,7 @@ public class EventDetailsActivity extends ActionBarActivity implements LoaderCal
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Loader<Event> onCreateLoader(int id, Bundle args) {
|
public Loader<Event> onCreateLoader(int id, Bundle args) {
|
||||||
return new EventLoader(this, Integer.parseInt(getIntent().getDataString()));
|
return new EventLoader(this, Long.parseLong(getIntent().getDataString()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -381,7 +381,7 @@ public class DatabaseManager {
|
||||||
/**
|
/**
|
||||||
* Returns the event with the specified id.
|
* Returns the event with the specified id.
|
||||||
*/
|
*/
|
||||||
public Event getEvent(int id) {
|
public Event getEvent(long id) {
|
||||||
String[] selectionArgs = new String[] { String.valueOf(id) };
|
String[] selectionArgs = new String[] { String.valueOf(id) };
|
||||||
Cursor cursor = helper
|
Cursor cursor = helper
|
||||||
.getReadableDatabase()
|
.getReadableDatabase()
|
||||||
|
|
|
@ -119,7 +119,7 @@ public class AlarmIntentService extends IntentService {
|
||||||
}
|
}
|
||||||
} else if (AlarmReceiver.ACTION_NOTIFY_EVENT.equals(action)) {
|
} else if (AlarmReceiver.ACTION_NOTIFY_EVENT.equals(action)) {
|
||||||
|
|
||||||
int eventId = Integer.parseInt(intent.getDataString());
|
long eventId = Long.parseLong(intent.getDataString());
|
||||||
Event event = DatabaseManager.getInstance().getEvent(eventId);
|
Event event = DatabaseManager.getInstance().getEvent(eventId);
|
||||||
if (event != null) {
|
if (event != null) {
|
||||||
|
|
||||||
|
@ -149,7 +149,7 @@ public class AlarmIntentService extends IntentService {
|
||||||
Notification notification = new NotificationCompat.Builder(this).setSmallIcon(R.drawable.ic_launcher).setWhen(event.getStartTime().getTime())
|
Notification notification = new NotificationCompat.Builder(this).setSmallIcon(R.drawable.ic_launcher).setWhen(event.getStartTime().getTime())
|
||||||
.setContentTitle(event.getTitle()).setContentText(contentText).setContentInfo(event.getRoomName()).setContentIntent(eventPendingIntent)
|
.setContentTitle(event.getTitle()).setContentText(contentText).setContentInfo(event.getRoomName()).setContentIntent(eventPendingIntent)
|
||||||
.setAutoCancel(true).setDefaults(defaultFlags).setPriority(NotificationCompat.PRIORITY_DEFAULT).build();
|
.setAutoCancel(true).setDefaults(defaultFlags).setPriority(NotificationCompat.PRIORITY_DEFAULT).build();
|
||||||
notificationManager.notify(eventId, notification);
|
notificationManager.notify((int) eventId, notification);
|
||||||
}
|
}
|
||||||
|
|
||||||
AlarmReceiver.completeWakefulIntent(intent);
|
AlarmReceiver.completeWakefulIntent(intent);
|
||||||
|
|
Loading…
Reference in a new issue