use of org.telegram.ui.LocationActivity in project Telegram-FOSS by Telegram-FOSS-Team.
the class FragmentContextView method openSharingLocation.
private void openSharingLocation(final LocationController.SharingLocationInfo info) {
if (info == null || !(fragment.getParentActivity() instanceof LaunchActivity)) {
return;
}
LaunchActivity launchActivity = ((LaunchActivity) fragment.getParentActivity());
launchActivity.switchToAccount(info.messageObject.currentAccount, true);
LocationActivity locationActivity = new LocationActivity(2);
locationActivity.setMessageObject(info.messageObject);
final long dialog_id = info.messageObject.getDialogId();
locationActivity.setDelegate((location, live, notify, scheduleDate) -> SendMessagesHelper.getInstance(info.messageObject.currentAccount).sendMessage(location, dialog_id, null, null, null, null, notify, scheduleDate));
launchActivity.presentFragment(locationActivity);
}
Aggregations