Это мой код:Почему google map API v2 показывает пустую карту?
public class Map extends ActionBarActivity{
GoogleMap map;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_map);
getSupportActionBar().setDisplayShowHomeEnabled(true);
getSupportActionBar().setLogo(R.drawable.ic_launcher);
getSupportActionBar().setDisplayUseLogoEnabled(true);
// Initializing
int status = GooglePlayServicesUtil.isGooglePlayServicesAvailable(getApplicationContext());
markerPoints = new ArrayList<LatLng>();
// Showing status
if(status!=ConnectionResult.SUCCESS){ // Google Play Services are not available
int requestCode = 10;
Dialog dialog = GooglePlayServicesUtil.getErrorDialog(status, this, requestCode);
dialog.show();
}else { // Google Play Services are available
// Getting reference to the SupportMapFragment of activity_main.xml
SupportMapFragment fm = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map);
// Getting GoogleMap object from the fragment
map = fm.getMap();
if (map == null) {
Toast.makeText(getApplicationContext(),"Sorry! unable to create maps", Toast.LENGTH_SHORT).show();
}
// Enabling MyLocation Layer of Google Map
map.setMyLocationEnabled(true);
}
}
}
Я уверен, что мой ключ API и разрешение прав. Потому что я использовал его для этого проекта в прошлом, и он сработал. Но я не знаю, почему он сейчас не работает. Может кто-нибудь показать мне, почему, пожалуйста? Я изменил свой ключ API, но он все еще не работает.
Какая ошибка вы видите? код статуса? –
Я использую реальный прибор. Поэтому я не вижу код состояния. @Sunil B N. – Hades10
Но это сработало в прошлом. @Sunil B N – Hades10