• 10
name

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191

Backtrace:

File: /home/prodcxja/public_html/questions/application/views/question.php
Line: 191
Function: _error_handler

File: /home/prodcxja/public_html/questions/application/controllers/Questions.php
Line: 433
Function: view

File: /home/prodcxja/public_html/questions/index.php
Line: 315
Function: require_once

I am developing an app having a feature that link to "Google map" via Intent to show direction, it works ok with the devices using Google map. But in some devices use "Google map go" and "Navigation for google map go", seem like these app don't handle Intent the same with "Google map".

I tried to replace "Google map" package with "Google map go" and "Navigation for google map go" package. But it wasn't work.

Uri gmmIntentUri = Uri.parse("google.navigation:q=" + destinationPoint.latitude + "," + destinationPoint.longitude + "&mode=d");

Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri);
mapIntent.setPackage("com.google.android.apps.navlite");

context.startActivity(mapIntent);

I research and couldn't find any docs about that, so how to do that?

String uri = String.format(Locale.ENGLISH, "geo:%f,%f?z=%d&q=%f,%f(%s)",
                latitude, longitude, 16, latitude, longitude,
                "Your Location TEXT");

        //Try for google Maps 1st.
        Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri));
        intent.setPackage("com.google.android.apps.maps");
        try
        {
            (getContext()). startActivity(intent);
        }
        catch(ActivityNotFoundException ex)
        {
            try
            {//Now try for GO MAPS / Browser
                uri = "http://maps.google.com/maps?daddr=" + latitude + "," + longitude ;



                Intent unrestrictedIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri));
                (getContext()).startActivity(unrestrictedIntent);
            }
            catch(ActivityNotFoundException innerEx)
            {//Finally show a toast.
                Toast.makeText((v.getContext().getApplicationContext()),
                        "Install Google maps") , Toast.LENGTH_LONG).show();
            }
        }
  • 1
Reply Report
      • 2
    • Thank for your solution, but this code just display Google map go, User has to click one more button to open Navigation for google map go. And my customer request open directly Navigation for google map go from my app