Hello,
I'm trying to create my first library
but something is wrong ...
could you tell me where I'm wrong?
Who can help me?
I'm trying to create my first library
but something is wrong ...
could you tell me where I'm wrong?
Who can help me?
B4X:
package net.snclabs.LightNotify;
import anywheresoftware.b4a.BA.ShortName;
import android.content.BroadcastReceiver;
import android.content.Intent;
@ShortName("LightNotify")
public class LightNotify {
private String PackageName2;
public void Initialize(String PackageName) {
PackageName2 = PackageName;
}
public void NotifyAdd(String NotificationText, String TextToShow) {
Intent intent = new Intent(PackageName2);
intent.putExtra(NotificationText, TextToShow);
context.sendBroadcast(intent);
}
public void NotifyClear() {
Intent intent = new Intent(PackageName2 + ".CLEARED_NOTIFICATION");
context.sendBroadcast(intent);
}
public void SwippingMethod() {
Intent deleteIntent = new Intent(context,NotificationReceiver.class);
notification.deleteIntent = PendingIntent.getBroadcast(context,0,deleteIntent, 0);
}
public class NotificationReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
Intent intent1 = new Intent(PackageName2 + ".CLEARED_NOTIFICATION");
context.sendBroadcast(intent1);
}
}
}