Advertisement
Guest User

Untitled

a guest
Feb 11th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. procedure
  2.  
  3. TAndroidServiceDM.LaunchNotification(AName,ATitle,AAlertBody:String);
  4. var
  5. MyNotification: TNotification;
  6. begin
  7. MyNotification := NotificationCenter1.CreateNotification;
  8. try
  9. MyNotification.Name := AName;
  10. MyNotification.Title := ATitle;
  11. MyNotification.AlertBody := AAlertBody;
  12. MyNotification.FireDate := Now;
  13. NotificationCenter1.ScheduleNotification(MyNotification); // app crash
  14. finally
  15. MyNotification.Free;
  16. end;
  17. end;
  18.  
  19. LaunchIntent := TAndroidHelper.Context.getPackageManager().getLaunchIntentForPackage(TAndroidHelper.Context.getPackageName());
  20. AIntent.putExtra(TJNotificationInfo.JavaClass.EXTRA_ACTIVITY_CLASS_NAME, LaunchIntent.getComponent().getClassName());
  21.  
  22. <intent-filter>
  23. <action android:name="android.intent.action.MAIN" />
  24. <category android:name="android.intent.category.LAUNCHER" />
  25.  
  26. <action android:name="android.intent.action.VIEW" />
  27. <category android:name="android.intent.category.DEFAULT" />
  28. <category android:name="android.intent.category.BROWSABLE" />
  29. <data android:mimeType="text/pas" />
  30. </intent-filter>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement