Hi, I'm trying to create an intent in android, but the objective is to check if the intent exists and if it exists, destroy it and call a new intent with different parameters, this is the calling code.
public void Safesearch(String urlgoogle){
String urlString=(urlgoogle.concat("&safe=active"));
Intent intent=new Intent(Intent.ACTION_VIEW,Uri.parse(urlString));
intent.setPackage("com.android.chrome");
try {
startActivity(intent);
} catch (ActivityNotFoundException ex) {
intent.setPackage(null);
startActivity(intent);
}
}