Note that there are some explanatory texts on larger screens.

plurals
  1. POLaunched application not updating search query
    primarykey
    data
    text
    <p>I am currently developing an android app that must launch other applications (YouTube, etc) to perform search queries. I have succeeded in sending search queries to other applications via the following code:</p> <pre><code>searchIntent = new Intent(Intent.ACTION_SEARCH); searchIntent.putExtra("query", searchPhrase); searchIntent.setPackage(packageName); //Youtube package name, etc startActivity(searchIntent); </code></pre> <p>Unfortunately, when the queried app is left running and another query is performed, it simply relaunches with the original query, failing to perform another search.</p> <p>For example: I launch a search intent for YouTube with the name "puppies." I then background that instance of YouTube and launch another search intent with the name "kittens." Upon launching that second intent, the same instance of YouTube launches and continues to show "puppies" in the search bar.</p> <p>I have tried using various flags (FLAG_ACTIVITY_NEW TASK, FLAG_ACTIVITY_CLEAR_TOP, and others) to no avail to solve this problem.</p> <p>Does anyone know how I may go about resetting the search query in the launched activity so that a second search can be performed without having to kill the activity instance (back button or otherwise)?</p> <p>Thanks in advance for your assistance!</p> <p>EDIT: I have found this issue to be specific to intents being launched from services. If the intent is launched from an activity, the launching app seamlessly transitions into the launched app, and one is forced to press the back button in order to return to the launching app. Unfortunately, I am trying to launch this intent from an IntentService, thus I am having this issue.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload