Não esta carregando o mapa.
public class AguardandoValidacaoATM extends AppCompatActivity {
private GoogleMap mMap;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_aguardando_validacao_atm);
Button botao_mapa = (Button) findViewById(R.id.bt_validacao_mapa);
botao_mapa.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent vaiParaMapa = new Intent(AguardandoValidacaoATM.this, MapaActivity.class);
Toast.makeText(AguardandoValidacaoATM.this, "Localize agencia mais próxima", Toast.LENGTH_SHORT).show();
startActivity(vaiParaMapa);
}
});
}
}
Manifest.xml
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="@string/google_maps_key" />
<activity android:name=".ui.MapaActivity"></activity>
</application>
MapaActivity
public class MapaActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_mapa);
FragmentManager manager = getSupportFragmentManager();
FragmentTransaction tx = manager.beginTransaction();
tx.replace(R.id.frame_mapa, new SupportMapFragment());
tx.commit();
google_maps_api.xml
<string name="google_maps_key" templateMergeStrategy="preserve" translatable="false">minhaKey</string>