I have a search screen that can be launched by clicking on the "name" field of another screen.
If the user follows this workflow, I add an additional instance of Intent Extras called "search". This additionally uses text that fills in the name field as its value. When the search screen is created, this additional parameter is used as the search parameter, and the search is automatically started for the user.
However, since Android destroys and recreates actions when the screen rotates, turning the phone again causes an automatic search. Because of this, I would like to remove the “search” from the “Action” action when the initial search is performed.
I tried to do it like this:
Bundle extras = getIntent().getExtras(); if (extras != null) { if (extras.containsKey("search")) { mFilter.setText(extras.getString("search")); launchSearchThread(true); extras.remove("search"); } }
However, this does not work. If I rotate the screen again, an additional “search” still exists in the Extension Activity Intent.
Any ideas?
android android-intent
Andrew Dec 23 '10 at 17:14 2010-12-23 17:14
source share