Hi,
I contacted the developer of the app LightFlow to implement the compatibility of my app with her.
asked me to add some code to my application, but the code provided by him should be used with Eclipse.
Could you help me to fit on Basic4Android?
I will follow in the mail I received.
Thanks a lot in advance
Fabio
I contacted the developer of the app LightFlow to implement the compatibility of my app with her.
asked me to add some code to my application, but the code provided by him should be used with Eclipse.
Could you help me to fit on Basic4Android?
I will follow in the mail I received.
Thanks a lot in advance
Fabio
HTML:
Excellent.
Ok, so basically anywhere in your app that you raise a notification add in the following:
Intent intent = new Intent("com.digibites.calendar.NEW_NOTIFICATION");
data.putExtra("NEW_NOTIFICATION_TEXT", "The text you would show for a notification");
context.sendBroadcast(intent);
Note this code references com.digibites.calendar, but change this to a unique reference (such as the package name) for your app. If you've a free version and a paid version you don't need to set a different identifier for each, just use one.
This will issue out a broadcast that LightFlow can pick up on for the new notification.
Anywhere that you clear a notification, just add the following two lines of code:
Intent intent = new Intent("com.digibites.calendar.CLEARED_NOTIFICATION");
context.sendBroadcast(intent);
This will handle most events, but the most tricky one is swiping away notifications. For this before raising a notification you'll need to register a delete intent that allows code to be run when the notification is swiped away, so add these lines before the notificationManager.notify is issued:
Intent deleteIntent = new Intent(context,NotificationReceiver.class);
notification.deleteIntent = PendingIntent.getBroadcast(context,0,deleteIntent, 0);
Then finally add a new notification receiver that will pick up on notifications being swiped away (as they were registered with the pending deleteIntent above) and then broadcast them out in the same way as any other notification that's cleared.
Put this info the android manifest.
<receiver android:name=".NotificationReceiver" > </receiver>
And create a new class as below:
public class NotificationReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
Intent intent = new Intent("com.digibites.calendar.CLEARED_NOTIFICATION");
context.sendBroadcast(intent);
}
}
Let me know if you need any more information. Once you've added this, I'll add in some matching up code in my app which I could e-mail you through to try (or I'm happy to try with your app)
Thanks