如何获取Android的街景全景图像数据,我想将街景图像数据传递到另一个Java文件的硬纸板视图中,然后硬纸板将加载图像数据并显示它。谁能帮我?谢谢。
public class MainActivity extends AppCompatActivity {
private static final LatLng SYDNEY = new LatLng(-33.87365, 151.20689);
private VrPanoramaView panoWidgetView;
@Override
protected void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
SupportStreetViewPanoramaFragment streetViewPanoramaFragment =
(SupportStreetViewPanoramaFragment)
getSupportFragmentManager().findFragmentById(R.id.streetviewpanorama);
streetViewPanoramaFragment.getStreetViewPanoramaAsync(
new OnStreetViewPanoramaReadyCallback() {
@Override
public void onStreetViewPanoramaReady(StreetViewPanorama panorama) {
// Only set the panorama to SYDNEY on startup (when no panoramas have been
// loaded which is when the savedInstanceState is null).
if (savedInstanceState == null) {
panorama.setPosition(SYDNEY);
}
}
});
}
}