Facebook Friends Mapper Android -
private void showFriendDetailsDialog(FriendLocation friend) { new AlertDialog.Builder(this) .setTitle(friend.name) .setMessage("Location: " + friend.location + "\n" + "Coordinates: " + friend.latitude + ", " + friend.longitude) .setPositiveButton("Close", null) .setNeutralButton("Show on Map", (dialog, which) -> { LatLng position = new LatLng(friend.latitude, friend.longitude); googleMap.animateCamera(CameraUpdateFactory.newLatLngZoom(position, 12)); }) .show(); }
</LinearLayout> </androidx.cardview.widget.CardView> facebook friends mapper android
@Override public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { super.onRequestPermissionsResult(requestCode, permissions, grantResults); if (requestCode == LOCATION_PERMISSION_REQUEST) { if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) { googleMap.setMyLocationEnabled(true); } } } } " + friend.longitude) .setPositiveButton("Close"
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <androidx.cardview.widget.CardView android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="8dp" app:cardElevation="4dp"> null) .setNeutralButton("Show on Map"