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

Avoid null context in fragments. #237

Conversation

pnemonic78
Copy link
Collaborator

Fatal Exception: java.lang.IllegalStateException: Fragment TransactionFormFragment{249d286} (ad28f118-0970-4ee9-a7ee-24e1d56829ae) not attached to a context.
       at androidx.fragment.app.Fragment.requireContext(Fragment.java:967)
       at org.gnucash.android.ui.transaction.TransactionFormFragment.onOptionsItemSelected(TransactionFormFragment.java:941)
       at org.gnucash.android.app.MenuFragment$onCreate$1.onMenuItemSelected(MenuFragment.kt:23)
       at androidx.core.view.MenuHostHelper.onMenuItemSelected(MenuHostHelper.java:107)
       at androidx.activity.ComponentActivity.onMenuItemSelected(ComponentActivity.java:532)
       at androidx.fragment.app.FragmentActivity.onMenuItemSelected(FragmentActivity.java:265)
       at androidx.appcompat.app.AppCompatActivity.onMenuItemSelected(AppCompatActivity.java:269)
       at androidx.appcompat.view.WindowCallbackWrapper.onMenuItemSelected(WindowCallbackWrapper.java:109)
       at androidx.appcompat.app.ToolbarActionBar$2.onMenuItemClick(ToolbarActionBar.java:66)
       at androidx.appcompat.widget.Toolbar$1.onMenuItemClick(Toolbar.java:224)
       at androidx.appcompat.widget.ActionMenuView$MenuBuilderCallback.onMenuItemSelected(ActionMenuView.java:769)
       at androidx.appcompat.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:833)
       at androidx.appcompat.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:157)
       at androidx.appcompat.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:984)
       at androidx.appcompat.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:974)
       at androidx.appcompat.widget.ActionMenuView.invokeItem(ActionMenuView.java:620)
       at androidx.appcompat.view.menu.ActionMenuItemView.onClick(ActionMenuItemView.java:155)
       at android.view.View.performClick(View.java:7535)
       at android.view.View.performClickInternal(View.java:7512)
       at android.view.View.-$$Nest$mperformClickInternal()
       at android.view.View$PerformClick.run(View.java:29496)
       at android.os.Handler.handleCallback(Handler.java:984)
       at android.os.Handler.dispatchMessage(Handler.java:104)
       at android.os.Looper.loopOnce(Looper.java:238)
       at android.os.Looper.loop(Looper.java:357)
       at android.app.ActivityThread.main(ActivityThread.java:8194)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:957)

@pnemonic78 pnemonic78 merged commit 9274192 into GnuCash-Pocket:master Jan 9, 2025
5 checks passed
@pnemonic78 pnemonic78 deleted the issue/c7770dbdd6d08d94b899c16e0e12bff4 branch January 9, 2025 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants