tlmarker1968

Untitled

Mar 23rd, 2021
1,573
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.64 KB | None | 0 0
  1. Here is my function to call a map:
  2.  
  3.             holder.btnGPS.setOnClickListener(new View.OnClickListener() {
  4.                 @Override
  5.                 public void onClick(View v) {
  6.                     Uri location = Uri.parse(holder.txtAddress.getText().toString().replace(" ", "+"));
  7.                     Intent intent = new Intent(Intent.ACTION_VIEW, location);
  8.                     intent.setPackage("com.google.android.apps.maps");
  9.                     startActivity(intent);
  10.                 }
  11.             });
  12.  
  13. and I have this permission set in my manifest:
  14.     <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
Advertisement
Add Comment
Please, Sign In to add comment