Estoy creando una APP que principalmente se usa desde un Windows Float estilo al que usa Facebook Messenger, al pulsar sobre el se abre varias opciones (botones)
Por ejemplo el primero abre la aplicación google Maps, el segundo una Actividad interna, etc...
Lo que sucede es que si abro desde Windows Float Google Maps, y desde el Windows Float abro una actividad y vuelto a pulsar en el icono de Google Maps, esta se abre desde cero como nueva, perdiendo el destino o lo que se tenia. Y si vuelvo a la CallsActivity sucede lo mismo se ha detenido la actividad alcambiar perdiendo lo que tenia.
ImageView gpsButton = (ImageView) mFloatingView.findViewById(R.id.btn_GPS);
gpsButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(Service_SoftKeysFloat.this, "GPS.", Toast.LENGTH_LONG).show();
// mode:
// d -> Auto
// w -> a pie
// d -> en bicicleta
// avoid
// t -> evitar peajes
// h -> evitar autopistas
// f -> evitar transbordadores
// San Martin Coordenadas: 40.389932, -4.372887
//Uri gmmIntentUri = Uri.parse("google.navigation:q=Calle Bureba 26,Leganes&mode=d&avoid=tf");
//Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri);
IntentGPS = new Intent(Intent.ACTION_VIEW);
IntentGPS.setPackage("com.google.android.apps.maps");
if (IntentGPS.resolveActivity(getPackageManager()) != null) {
startActivity(IntentGPS.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK).addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY));
}
// Cierra la lista de opciones
expandedView.setVisibility(View.GONE);
collapsedView.setVisibility(View.VISIBLE);
}
});
//Set the Call button.
ImageView callButton = (ImageView) mFloatingView.findViewById(R.id.btn_Calls);
callButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(Service_SoftKeysFloat.this, "Calls.", Toast.LENGTH_LONG).show();
IntentCalls = new Intent(getApplicationContext(), CallsActivity.class);
startActivity(IntentCalls.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK).addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY));
// Cierra la lista de opciones
expandedView.setVisibility(View.GONE);
collapsedView.setVisibility(View.VISIBLE);
}
});