Fixed
Status Update
Comments
jb...@google.com <jb...@google.com> #2
Please include a sample project that reproduces your issue.
jv...@gmail.com <jv...@gmail.com> #3
Here is the sample project.
Steps to reproduce:
1. Press on "Search" icon;
2. Write something;
3. Search this text, keyboard will be dismissed;
4. Tap on "Dialog" button;
5. Dissmiss dialog;
With the new 1.5.0 fragment library version text will be cleared in the search box after dismissing dialog.
In the version 1.4.1 and lower text in the search is not clearing and this is correct behaviour.
Please suggest some workarounds or how to fix this issue?
Steps to reproduce:
1. Press on "Search" icon;
2. Write something;
3. Search this text, keyboard will be dismissed;
4. Tap on "Dialog" button;
5. Dissmiss dialog;
With the new 1.5.0 fragment library version text will be cleared in the search box after dismissing dialog.
In the version 1.4.1 and lower text in the search is not clearing and this is correct behaviour.
Please suggest some workarounds or how to fix this issue?
il...@google.com <il...@google.com>
an...@immobiliare.it <an...@immobiliare.it> #4
Hello, have you checked sample project? I hope it will help find the issue.
sa...@google.com <sa...@google.com>
ap...@google.com <ap...@google.com> #5
il...@google.com <il...@google.com> #6
Hello, any update please?
il...@google.com <il...@google.com> #7
Hello
I raised similar issue with this ticket
This makes the SearchView unusable/broken when fragments are changed (i.e base on searchView input query)
What can we do to fix this problem? What is the progress of work on solving this problem?
na...@google.com <na...@google.com> #8
@7 Check @5 for a workaround.
Description
- **androix.fragment**: `androidx.fragment:fragment:1.3.6`
- **androix.activity**: `androidx.activity:activity:1.2.4`
Devices/Android versions reproduced on: Samsung Galaxy S10 Lite
**Issue**
When multiple activities are launched sequentially from a fragment using the deprecated API `Fragment.startActivityForResult`, the order of launch is well defined but the calls back to `Fragment.onActivityResult` get messed up when all the started activities `setResult` and finish.
As it can be noticed in the logs below, `ResultActivity1` is started with `requestCode=1111` and `ResultActivity2` with `requestCode=2222`, but when both activities set result and dismiss, `onActivityResult` is called with `ResultActivity2` but `requestCode` of `ResultActivity1` and the same for `ResultActivity1`.
```
17:17:52.050 E startActivityForResult: me.jansv.ari.ResultActivity1{requestCode=1111}
17:17:52.187 E startActivityForResult: me.jansv.ari.ResultActivity2{requestCode=2222}
17:17:57.055 E onActivityResult: requestCode=1111, resultCode=-1, extras={ResultActivity2=ResultActivity2.value}
17:17:57.055 E onActivityResult: requestCode=2222, resultCode=-1, extras={ResultActivity1=ResultActivity1.value}
```
**Steps to reproduce**
Using the sample project, click rapidly and in order buttons `Activity 1` and `Activity 2`, then click `Set Result 2` followed by `Set Result 1`.
This is possible in the context of translucent activities that allow click-through or when some delay at starting the first activity allows the click on the second button to trigger.
**Potential cause**
When `Fragment.startActivityForResult` is called, it [register](
This means that if the state of the queue is something like: `{meta{requestCode=1111}, meta{requestCode=2222}}` for sequential launch of `ResultActivity1`, `ResultActivity2`. If `ResultActivity2` set result first, then, we'll endup with `meta{requestCode=1111}` and `ActivityResult` from `ResultActivity2`.