views:

61

answers:

1

In the examples, they create Intent as:

Intent intent = new Intent(this, AlarmReceiver.class);

But suppose my AlarmReceiver class is in another app, how do I create this intent?

I've tried with

new Intent("com.app.AlarmReceiver")

but nothing happens.. It was not called..

Any idea?

--Broadcast definition added using the manifest editor on Eclipse:

<receiver android:name="AlarmReceiver"></receiver>
</application>

--
Related:
http://stackoverflow.com/questions/3259912/how-do-i-start-my-app-from-my-other-app/3259975#3259975 (but this same code is not working for broadcasts..)

A: 

But my suppose my AlarmReceiver class is in another app, how do I create this intent?

If you wrote the other app, add an <intent-filter> with a custom action string to the other app's <receiver> element, then use an Intent with that action string.

If you did not write the other app, ask whoever wrote it what the Intent should look like.

CommonsWare
I've written it, and I already add to it: <receiver android:name="AlarmReceiver"></receiver>But it still not working..
Tom Brito
Oh god.. I had forgotten the intent-filter.. Actually, I was writing it in the name attribute.. XD Thanks!
Tom Brito