show Map - Android android.content

Android examples for android.content:Intent

Description

show Map

Demo Code

import android.content.Context;
import android.content.Intent;

public class Main {

  public static void showMap(Context context) {
    // Intent intent = new Intent(Intent.ACTION_VIEW);
    Intent intent = new Intent(Intent.ACTION_MAIN);
    // Uri.parse("http://ditu.google.cn/maps?hl=zh&mrt=loc&q=39.940409,116.355257(?????)"));
    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
    intent.setClassName("com.google.android.apps.maps", "com.google.android.maps.MapsActivity");
    context.startActivity(intent);/*from   w  ww  .  ja  v  a 2 s.c om*/
  }

}

Related Tutorials