TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
M.Dharani Masilamani
NA
28
2.5k
About google map in android
Jan 24 2018 11:22 PM
public
static
final
int
MY_PERMISSIONS_REQUEST_LOCATION = 90;
public
boolean checkLocationPermission(){
if
(ContextCompat.checkSelfPermission(
this
,
Manifest.permission.ACCESS_FINE_LOCATION)
!= PackageManager.PERMISSION_GRANTED) {
if
(ActivityCompat.shouldShowRequestPermissionRationale(
this
,
Manifest.permission.ACCESS_FINE_LOCATION)) {
ActivityCompat.requestPermissions(
this
,
new
String[]{Manifest.permission.ACCESS_FINE_LOCATION},
MY_PERMISSIONS_REQUEST_LOCATION);
}
else
{
ActivityCompat.requestPermissions(
this
,
new
String[]{Manifest.permission.ACCESS_FINE_LOCATION},
MY_PERMISSIONS_REQUEST_LOCATION);
}
return
false
;
}
else
{
return
true
;
}
}
@Override
public
void
onRequestPermissionsResult(
int
requestCode,
String permissions[],
int
[] grantResults) {
switch
(requestCode) {
case
MY_PERMISSIONS_REQUEST_LOCATION: {
if
(grantResults.length > 0
&& grantResults[0] == PackageManager.PERMISSION_GRANTED) {
if
(ContextCompat.checkSelfPermission(
this
,
Manifest.permission.ACCESS_FINE_LOCATION)
== PackageManager.PERMISSION_GRANTED) {
if
(mGoogleApiClient ==
null
) {
buildGoogleApiClient();
}
mMap.setMyLocationEnabled(
true
);
}
}
else
{
Toast.makeText(
this
,
"permission denied"
, Toast.LENGTH_LONG).show();
}
return
;
}
}
}
}
I am new to android in first line why we assignmy_permissions_request_location =90.
MY_PERMISSIONS_REQUEST_LOCATION = 90;
Reply
Answers (
1
)
External storage access denied in xamarin android
Fetch User Data According to login Details.