0

This is the view. here i have added the StreetViewPanormaFragment

<fragment xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:map="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/street_view_panorama_fragment"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.example.soulsystem_4.myapplication.MapsActivity"
    class="com.google.android.gms.maps.StreetViewPanoramaFragment"/>

This is the class in which i want to pass the latitude and longitude for that view. How to pass.

    private static final String EXTRA_LONG = "current_long";
    private static final String EXTRA_LAT = "current_lat";
    private static final String EXTRA_BEARING = "current_bearing";
    private static final String EXTRA_TILT = "current_tilt";
    private static final String EXTRA_ZOOM = "current_zoom";

    private GoogleApiClient mLocationClient;
    private Location mCurrentLocation;
    private float mBearing;
    private float mTilt;
    private float mZoom;

    private StreetViewPanorama mPanorama;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_maps);
        // Obtain the SupportMapFragment and get notified when the map is ready to be used.
        SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
                .findFragmentById(R.id.street_view_panorama_fragment);
        mapFragment.getMapAsync(this);
    }
    public void onMapReady(GoogleMap googleMap) {
        mMap = googleMap;

        // Add a marker in Sydney and move the camera
        LatLng sydney = new LatLng(-34, 151);
        mMap.addMarker(new MarkerOptions().position(sydney).title("Marker in Sydney"));
        mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));
    }

    @Override
    public void onConnected(@Nullable Bundle bundle) {

    }

    @Override
    public void onConnectionSuspended(int i) {

    }

    @Override
    public void onConnectionFailed(@NonNull ConnectionResult connectionResult) {

    }
}

I just want street view for location which i will pass to that view.

Rahul
  • 73
  • 10
  • 1
    Do you need to pass parameters from one activity to another one? Probably this post can be useful http://stackoverflow.com/questions/2405120/how-to-start-an-intent-by-passing-some-parameters-to-it – xomena Sep 30 '16 at 11:54

1 Answers1

0

private static final LatLng SYDNEY = new LatLng(-33.87365, 151.20689);

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_maps);

    StreetViewPanoramaFragment streetViewPanoramaFragment =
            (StreetViewPanoramaFragment) getFragmentManager()
                    .findFragmentById(R.id.street_view_panorama_fragment);
    streetViewPanoramaFragment.getStreetViewPanoramaAsync(this);

}
Rahul
  • 73
  • 10