Intent: Translating Java Example

littleviking

Member
Licensed User
Longtime User
Hello,

I am trying to make an 3rd-party addon to remote notifier. (ThirdPartyNotifications - android-notifier - How to send notifications from other applications through Android Remote Notifier - Desktop event notifier for Android devices - Google Project Hosting)
Their website gives these data for intents:

Intent i = new Intent(UserReceiver.ACTION);
i.putExtra(UserReceiver.EXTRA_TITLE, "Some title");
i.putExtra(UserReceiver.EXTRA_DESCRIPTION, "This is my test message.");
and this example:

public class UserTest extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Button b = new Button(this);
b.setText("Send message");
b.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Intent i = new Intent(UserReceiver.ACTION);
i.putExtra(UserReceiver.EXTRA_TITLE, "Some title");
i.putExtra(UserReceiver.EXTRA_DESCRIPTION, "This is my test message.");
sendBroadcast(i);
}
});
setContentView(b);
}
}

I tried this B4A-Code:

Dim Intent1 As Intent
Intent1.Initialize(Intent1.ACTION_MAIN,"UserReceiver.ACTION")
Intent1.SetComponent("org.damazio.notifier")
intent1.PutExtra("UserReceiver.EXTRA_TITLE", "Some title")
intent1.putExtra("UserReceiver.EXTRA_DESCRIPTION", "This is my test message.")
Dim p As Phone
p.SendBroadcastIntent(Intent1)

But it doesn't work. Remote Notifier doesn't get the message.

Anybody any ideas?

Thank you!
 
Top