How to notify user when he entered into a Movie theater in android?

大兔子大兔子 提交于 2019-12-03 16:38:14

Hey I found the solution Try This,

We have to implement PendingIntent & Location Manager. Location Manager obtain the current Location of user and when user entered in some region it will fire a pending intent some code snippet as follow:

//---use the LocationManager class to obtain locations data---
lm = (LocationManager)
getSystemService(Context.LOCATION_SERVICE);
//---PendingIntent to launch activity if the user is within some locations---
PendingIntent pendIntent = PendingIntent.getActivity(
this, 0, new
Intent(android.content.Intent.ACTION_VIEW,
Uri.parse("http://www.amazon.com")), 0);
lm.addProximityAlert(37.422006, -122.084095, 5, -1, pendIntent);

addProximityAlert method in which we can set the region (Radius for the User tracking) here is the more detail of addProximityAlert method.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!