Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CardTemplateFragment: TabLayoutMediator attached before ViewPager2 has an adapter #17384

Closed
Tracked by #17370
david-allison opened this issue Nov 7, 2024 · 1 comment · Fixed by #17407
Closed
Tracked by #17370
Labels

Comments

@david-allison
Copy link
Member

david-allison commented Nov 7, 2024

https://ankidroid.org/acra/app/1/bug/253711/report/ca45f20a-280b-48c8-b27c-31c240c5c3ec

java.lang.IllegalStateException: TabLayoutMediator attached before ViewPager2 has an adapter
	at com.google.android.material.tabs.TabLayoutMediator.attach(TabLayoutMediator.java:117)
	at com.ichi2.anki.CardTemplateEditor$CardTemplateFragment.initTabLayoutMediator(CardTemplateEditor.kt:678)
	at com.ichi2.anki.CardTemplateEditor$CardTemplateFragment.onViewCreated(CardTemplateEditor.kt:652)
	at androidx.fragment.app.Fragment.performViewCreated(Fragment.java:3152)
	at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:608)
	at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:286)
	at androidx.fragment.app.FragmentStore.moveToExpectedState(FragmentStore.java:114)
	at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1684)
	at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:3316)
	at androidx.fragment.app.FragmentManager.dispatchActivityCreated(FragmentManager.java:3234)
	at androidx.fragment.app.FragmentController.dispatchActivityCreated(FragmentController.java:263)
	at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:350)
	at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java:251)
	at com.ichi2.anki.AnkiActivity.onStart(AnkiActivity.kt:128)
	at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1432)
	at android.app.Activity.performStart(Activity.java:8003)
	at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3556)
	at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:226)
	at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:206)
	at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:178)
	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:102)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2230)
	at android.os.Handler.dispatchMessage(Handler.java:107)
	at android.os.Looper.loop(Looper.java:237)
	at android.app.ActivityThread.main(ActivityThread.java:7817)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1027)
@david-allison david-allison changed the title https://ankidroid.org/acra/app/1/bug/253711/report/ca45f20a-280b-48c8-b27c-31c240c5c3ec CardTemplateFragment: TabLayoutMediator attached before ViewPager2 has an adapter Nov 7, 2024
@david-allison
Copy link
Member Author

@SanjaySargam FYI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants