Ho problemi con:Fragment Android: frammento Impossibile creare un'istanza frammento
android.app.Fragment$InstantiationException: Unable to instantiate fragment ${packageName}.${activityClass}$GeneralPreferenceFragment
Il layout xml non funziona:
<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" />
Questo funziona però:
<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" />
Qualsiasi idea del perché ? Grazie!
L'esempio viene da SettingsActivty quando si crea un nuovo progetto da Android Eclipse e si interrompe solo su un tablet di dimensioni AVD.
Aggiunto questo al AndroidManifest:
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>)
Ho avuto lo stesso problema, qualcuno sa cosa sta succedendo? – Wang