In my application, I created a static method that returned the PendingIntent needed for the AlarmManager , and then I can call it from any class. If you have a PendingIntent that does not change between the moments, it is called, this may work for you. For example, I have:
public static PendingIntent getSyncPendingIntent(Context context) { Intent i = new Intent(context, <classname>.class); PendingIntent pi = PendingIntent.getBroadcast(context, 0, i, 0); return pi; }
And I can just call this from any class to get the same PendingIntent .
source share