I'm creating an APP that is mainly used from a Windows Float style that uses Facebook Messenger, by clicking on it opens several options (buttons)
For example, the first opens the Google Maps application, the second an Internal Activity, etc ...
What happens is that if I open Google Maps from Windows Float, and from the Windows Float I open an activity and click again on the Google Maps icon, it opens from scratch as new, losing the destination or what is I had. And if I go back to the CallsActivity it happens the same thing has stopped the activity to change losing what I had.
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);
}
});