Skip to content

Crash (IllegalStateException) when rapidly clicking search button in Settings #13467

@JeffHuang04

Description

@JeffHuang04

Checklist

  • I am able to reproduce the bug with the latest version given here: CLICK THIS LINK.
  • I made sure that there are no existing issues - open or closed - which I could contribute my information to.
  • I have read the FAQ and my problem isn't listed.
  • I have taken the time to fill in all the required details. I understand that the bug report will be dismissed otherwise.
  • This issue contains only one bug.
  • I have read and understood the contribution guidelines.
  • I have read and understood the AI policy. The content of this bug report is not generated by AI.

Affected version

0.28.4-Debug

Steps to reproduce the bug

1.Enter Settings: Open the app and navigate to the Settings screen

2.Trigger Search: Rapidly and repeatedly tap the Search icon in the top right corner of the toolbar.

I reproduce the bug by the auto testing tool.

The action and stack log is below.
action: 5@click className=android.widget.CheckedTextView,instance=4 :android.widget.CheckedTextView@720p
action: 6@click className=android.widget.CheckedTextView,instance=5 :android.widget.CheckedTextView@480p
action: 8@click className=android.widget.CheckedTextView,instance=7 :android.widget.CheckedTextView@240p
action: 2@click className=android.widget.CheckedTextView,instance=1 :android.widget.CheckedTextView@1080p60
action: 13@click className=android.widget.TextView,instance=12 :android.widget.TextView@recycler items_org.schabi.newpipe.settings.SettingsActivity_00000001000
action: 4@back
action: 14@click className=android.widget.TextView,instance=13 :android.widget.TextView@recycler items_org.schabi.newpipe.settings.SettingsActivity_00000001000
action: 21@back
action: 8@click className=android.widget.TextView,instance=3 :android.widget.TextView@recycler items_org.schabi.newpipe.settings.SettingsActivity_00000001000
action: 19@click className=android.widget.TextView,instance=15 :android.widget.TextView@recycler items_org.schabi.newpipe.settings.SettingsActivity_00000001000
action: 2@click resource-id=org.schabi.newpipe.debug:id/action_search :android.widget.Button@
--------- beginning of crash
05-01 10:16:24.675 11451 11451 E AndroidRuntime: FATAL EXCEPTION: main
05-01 10:16:24.675 11451 11451 E AndroidRuntime: Process: org.schabi.newpipe.debug, PID: 11451
05-01 10:16:24.675 11451 11451 E AndroidRuntime: java.lang.IllegalStateException: Fragment already added: PreferenceSearchFragment{5dc2475} (6c058a03-c11d-417a-8e66-53605204f89d id=0x7f0a0394 tag=PreferenceSearchFragment)
05-01 10:16:24.675 11451 11451 E AndroidRuntime: at androidx.fragment.app.FragmentStore.addFragment(FragmentStore.java:93)

Expected behavior

No response

Actual behavior

No response

Screenshots/Screen recordings

No response

Logs

Image --------- beginning of crash 05-01 10:16:24.675 11451 11451 E AndroidRuntime: FATAL EXCEPTION: main 05-01 10:16:24.675 11451 11451 E AndroidRuntime: Process: org.schabi.newpipe.debug, PID: 11451 05-01 10:16:24.675 11451 11451 E AndroidRuntime: java.lang.IllegalStateException: Fragment already added: PreferenceSearchFragment{5dc2475} (6c058a03-c11d-417a-8e66-53605204f89d id=0x7f0a0394 tag=PreferenceSearchFragment) 05-01 10:16:24.675 11451 11451 E AndroidRuntime: at androidx.fragment.app.FragmentStore.addFragment(FragmentStore.java:93) 05-01 10:16:24.675 11451 11451 E AndroidRuntime: at androidx.fragment.app.FragmentManager.addFragment(FragmentManager.java:1733) 05-01 10:16:24.675 11451 11451 E AndroidRuntime: at androidx.fragment.app.BackStackRecord.executeOps(BackStackRecord.java:389) 05-01 10:16:24.675 11451 11451 E AndroidRuntime: at androidx.fragment.app.FragmentManager.executeOps(FragmentManager.java:2280) 05-01 10:16:24.675 11451 11451 E AndroidRuntime: at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2165) 05-01 10:16:24.675 11451 11451 E AndroidRuntime: at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:2109) 05-01 10:16:24.675 11451 11451 E AndroidRuntime: at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:2052) 05-01 10:16:24.675 11451 11451 E AndroidRuntime: at androidx.fragment.app.FragmentManager$5.run(FragmentManager.java:703) 05-01 10:16:24.675 11451 11451 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:873) 05-01 10:16:24.675 11451 11451 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:99) 05-01 10:16:24.675 11451 11451 E AndroidRuntime: at android.os.Looper.loop(Looper.java:193) 05-01 10:16:24.675 11451 11451 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6669) 05-01 10:16:24.675 11451 11451 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method) 05-01 10:16:24.675 11451 11451 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) 05-01 10:16:24.675 11451 11451 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) Image

Affected Android/Custom ROM version

No response

Affected device model

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue is related to a bugneeds triageIssue is not yet ready for PR authors to take up

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions