Skip to content

Instantly share code, notes, and snippets.

@DelphiWorlds
Created October 16, 2021 00:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DelphiWorlds/1a7534be4f765ab2acd4d780c5b54550 to your computer and use it in GitHub Desktop.
Save DelphiWorlds/1a7534be4f765ab2acd4d780c5b54550 to your computer and use it in GitHub Desktop.
How to put a PendingIntent into an ArrayList
uses
Androidapi.JNI.JavaTypes, Androidapi.JNI.App, Androidapi.JNI.GraphicsContentViewText, Androidapi.Helpers;
var
LArrayList: JArrayList;
LIntent: JIntent;
LPendingIntent: JPendingIntent
begin
LIntent := TJIntent.Create;
// *** Here, call setAction and whatever else needs to be done to initialize LIntent ***
LPendingIntent := TJPendingIntent.JavaClass.getBroadcast(TAndroidHelper.Context, 0, LIntent, 0);
LArrayList := TJArrayList.Create;
LArrayList.add(LPendingIntent);
// Now you can pass LArrayList to a method that takes one as a parameter
end;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment