I have the following Activity which starts a service type service on android for it within my class Activity I have the following
Intent i_service = new Intent(getApplicationContext(), MyService.class);
i_service.putExtra("nombre_clase", "Mapas");
startService(i_service);
and in my MyService.class class I have the following:
public int onStartCommand(Intent intent, int flags, int startId) {
Log.d(var,"servicio stratcomand");
String nombre_clase = intent.getStringExtra("nombre_clase");
Log.d("bbbbbbbbbb", "valor: "+nombre_clase);
if(nombre_clase == "Mapas"){
Log.d("aaaaaaaaaaa", "valor: "+nombre_clase);
}else{
Log.d("aaaaaaaaaaa", "noo error ");
}
return super.onStartCommand(intent, flags, startId);
}
Before entering the condition I print the variable name_class which does not present any error, but when I want to print the value of the same variable within the condition I always get the message "no error", since the value "Maps" if it exists.
What I want to know is how to solve this problem, in advance I thank you