I have poured over every example that I can find and I have gone through the official documentation from google. All I am trying to do is create a toast notification from a
As bigstones wrote, you need to use broadcast. Sample code:
protected PendingIntent getPendingSelfIntent(Context context, String action) {
Intent intent = new Intent(context, getClass());
intent.setAction(action);
return PendingIntent.getBroadcast(context, 0, intent, 0);
}
views.setOnClickPendingIntent(R.id.Timm, getPendingSelfIntent(context,
"ham"));