J'ai un problème:Fragment android: fragment Impossible d'instancier fragment
android.app.Fragment$InstantiationException: Unable to instantiate fragment ${packageName}.${activityClass}$GeneralPreferenceFragment
La mise en page XML ne fonctionne pas:
<preference-headers xmlns:android="http://schemas.android.com/apk/res/android" >
<!-- These settings headers are only used on tablets. -->
<header
android:fragment="${packageName}.${activityClass}$GeneralPreferenceFragment"
android:title="@string/pref_header_general" />
Cela fonctionne bien:
<preference-headers xmlns:android="http://schemas.android.com/apk/res/android" >
<!-- These settings headers are only used on tablets. -->
<header
android:fragment="com.example.b.SettingsActivity$GeneralPreferenceFragment"
android:title="@string/pref_header_general" />
Toute idée pourquoi ? Merci!
Exemple provient de SettingsActivty lors de la création d'un nouveau projet à partir d'Android Eclipse et ne casse que sur un AVD de taille tablette.
a ajouté à la AndroidManifest:
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>)
J'ai eu le même problème, quelqu'un sait ce qui se passe? – Wang