java.lang.IllegalStateException: Fragment PreviewsFragment{485a655} not attached to Activity

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

Do you know how to solve this issue? Write a tip to help other users and build your expert profile.

Solutions on the web

via GitHub by jahirfiquitiva
, 1 year ago
Fragment PreviewsFragment{485a655} not attached to Activity
via Google Groups by Pee Wee, 3 months ago
Fragment SearchTransportFragment{413a8388} not attached to Activity
via GitHub by oakkitten
, 6 months ago
Fragment BF [irc.foo.bar] not attached to Activity
via GitHub by TarenJP
, 2 years ago
Fragment GoogleMapFragment{42a8a1e8} not attached to Activity
via GitHub by renas
, 2 years ago
Fragment LookFragment{4187f558} not attached to Activity
java.lang.IllegalStateException: Fragment PreviewsFragment{485a655} not attached to Activity
at android.support.v4.app.Fragment.getResources(Fragment.java:639)
at jahirfiquitiva.apps.iconshowcase.fragments.PreviewsFragment$1.onTabSelected(PreviewsFragment.java:98)
at android.support.design.widget.TabLayout.selectTab(TabLayout.java:871)
at android.support.design.widget.TabLayout.selectTab(TabLayout.java:841)
at android.support.design.widget.TabLayout$Tab.select(TabLayout.java:1115)
at android.support.design.widget.TabLayout.addTab(TabLayout.java:389)
at android.support.design.widget.TabLayout.addTab(TabLayout.java:361)
at android.support.design.widget.TabLayout.setTabsFromPagerAdapter(TabLayout.java:645)
at android.support.design.widget.TabLayout.setupWithViewPager(TabLayout.java:616)
at jahirfiquitiva.apps.iconshowcase.fragments.PreviewsFragment.createTabs(PreviewsFragment.java:86)
at jahirfiquitiva.apps.iconshowcase.fragments.PreviewsFragment.onResume(PreviewsFragment.java:69)
at android.support.v4.app.Fragment.performResume(Fragment.java:2005)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1108)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1248)
at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:738)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1613)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5470)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)

Users with the same issue

2 times, 9 months ago
12 times, 10 months ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
2 times, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 2 years ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.