1

I have created a TabActivity class which contains Activity.

I have crated Fragments and using that Fragment inside the activity.

Everything is working perfect until the screen gets locked.

When the screen gets locked, then the app crashes.

This is the stack trace

09-25 15:54:36.306: 
E/AndroidRuntime(21443): java.lang.IllegalArgumentException: 
No view found for id 0x7f09003d (...id/linearLayoutSC) for fragment SubCategoryGrid{42bbaf70 #7 id=0x7f09003d subCatList}

Please help me to resolve this issue.

I have tried to print the log in onDestroy() and onDetach() method. It gets called for all the Fragment in a TabActivity.

I have tried this links but not luck with that.

https://stackoverflow.com/a/9446326/1395259

IllegalArgumentException: No view found for id for fragment when fast switching ActionBar Tabs

Is this the bug??

https://code.google.com/p/android/issues/detail?id=19211

Community
  • 1
  • 1
Narendra Pal
  • 6,474
  • 13
  • 49
  • 85
  • 1
    I am working with Fragment mate. Inside 1 activity I have multiple fragment. If the screen gets locked, then onDetach() and onDestroy() is called for all the Fragments in the tabActivity. Thats why the layout file is also get missed. I want to save that. That is not the solution for my query. – Narendra Pal Sep 25 '13 at 10:45

2 Answers2

5

The issue is resolved.

I dont know what is the role of this here, but it solved my issue and working perfectly.

android:configChanges="orientation|keyboardHidden|screenSize"

I have written the above line in the menifest file inside activity

Now its working perfect.

Narendra Pal
  • 6,474
  • 13
  • 49
  • 85
0

my issue solved by adding in manifest: below code:

<activity
            android:name="com.android.Take Activity"
            android:exported="true"
             android:configChanges="orientation|screenSize"
            android:noHistory="true"
            android:screenOrientation="landscape"
            android:windowSoftInputMode="stateHidden" > </activity>
Xavi López
  • 27,550
  • 11
  • 97
  • 161
jesto paul
  • 438
  • 11
  • 21