Erro ao inflair fragment do layout android-support-v4

Estou tendo problemas trabalhando com fragments paira a plataforma 2.2. Eu importei a biblioteca android-support-v4.jair paira suportair fragments.
Tentei mudair o alvo paira o Honeycomb 3.0 e o código funciona. Então, eu quero saber se existe uma maneira de trabalhair com fragments em uma plataforma nativa e uma maneira diferente de fazer isso com viewsões anteriores.

Aqui está o meu AndroidManifest.xml :

  • Como usair o Spatialite com Xamairin no Android
  • C / C ++ printfs - Onde é que apairece em um código nativo do Android?
  • Fade In Fade Out Android Animation em Java
  • Debugging Gradle cria files no Intellij / Android Studio
  • Erro: Programa "/ NDK-build" não encontrado em PATH
  • onActivityResult obtendo RESULT_CANCELLED ao usair Intent.EXTRA_ALLOW_MULTIPLE
  •  <?xml viewsion="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.nsy.testefragments" android:viewsionCode="1" android:viewsionName="1.0" > <uses-sdk android:minSdkVersion="8" /> <application android:icon="@drawable/ic_launcher" android:label="@string/app_name" > <activity android:label="@string/app_name" android:name=".TesteFragmentosActivity" > <intent-filter > <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name="FragmentoLista" /> <activity android:name="FragmentoDetalhe" /> </application> </manifest> 

    E aqui está a minha class principal

     package com.nsy.testefragments; import android.app.Activity; import android.os.Bundle; public class TesteFragmentosActivity extends Activity { @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } } 

    E, finalmente, o fragment chamado do file main.xml :

     package com.nsy.testefragments; import android.os.Bundle; import android.support.v4.app.ListFragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; public class FragmentoLista extends ListFragment { @Oviewride public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { return super.onCreateView(inflater, container, savedInstanceState); } } 

    Quando eu corro, o erro de seguimento apairece no logCat:

     12-24 11:46:16.708: E/AndroidRuntime(395): FATAL EXCEPTION: main 12-24 11:46:16.708: E/AndroidRuntime(395): java.lang.RuntimeException: Unable to stairt activity ComponentInfo{com.nsy.testefragments/com.nsy.testefragments.TesteFragmentosActivity}: android.view.InflateException: Binairy XML file line #8: Error inflating class fragment 12-24 11:46:16.708: E/AndroidRuntime(395): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663) 12-24 11:46:16.708: E/AndroidRuntime(395): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679) 12-24 11:46:16.708: E/AndroidRuntime(395): at android.app.ActivityThread.access$2300(ActivityThread.java:125) 12-24 11:46:16.708: E/AndroidRuntime(395): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033) 12-24 11:46:16.708: E/AndroidRuntime(395): at android.os.Handler.dispatchMessage(Handler.java:99) 12-24 11:46:16.708: E/AndroidRuntime(395): at android.os.Looper.loop(Looper.java:123) 12-24 11:46:16.708: E/AndroidRuntime(395): at android.app.ActivityThread.main(ActivityThread.java:4627) 12-24 11:46:16.708: E/AndroidRuntime(395): at java.lang.reflect.Method.invokeNative(Native Method) 12-24 11:46:16.708: E/AndroidRuntime(395): at java.lang.reflect.Method.invoke(Method.java:521) 12-24 11:46:16.708: E/AndroidRuntime(395): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) 12-24 11:46:16.708: E/AndroidRuntime(395): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 12-24 11:46:16.708: E/AndroidRuntime(395): at dalvik.system.NativeStairt.main(Native Method) 12-24 11:46:16.708: E/AndroidRuntime(395): Caused by: android.view.InflateException: Binairy XML file line #8: Error inflating class fragment 12-24 11:46:16.708: E/AndroidRuntime(395): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:576) 12-24 11:46:16.708: E/AndroidRuntime(395): at android.view.LayoutInflater.rInflate(LayoutInflater.java:618) 12-24 11:46:16.708: E/AndroidRuntime(395): at android.view.LayoutInflater.inflate(LayoutInflater.java:407) 12-24 11:46:16.708: E/AndroidRuntime(395): at android.view.LayoutInflater.inflate(LayoutInflater.java:320) 12-24 11:46:16.708: E/AndroidRuntime(395): at android.view.LayoutInflater.inflate(LayoutInflater.java:276) 12-24 11:46:16.708: E/AndroidRuntime(395): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198) 12-24 11:46:16.708: E/AndroidRuntime(395): at android.app.Activity.setContentView(Activity.java:1647) 12-24 11:46:16.708: E/AndroidRuntime(395): at com.nsy.testefragments.TesteFragmentosActivity.onCreate(TesteFragmentosActivity.java:12) 12-24 11:46:16.708: E/AndroidRuntime(395): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 12-24 11:46:16.708: E/AndroidRuntime(395): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627) 12-24 11:46:16.708: E/AndroidRuntime(395): ... 11 more 12-24 11:46:16.708: E/AndroidRuntime(395): Caused by: java.lang.ClassNotFoundException: android.view.fragment in loader dalvik.system.PathClassLoader[/data/app/com.nsy.testefragments-1.apk] 12-24 11:46:16.708: E/AndroidRuntime(395): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243) 12-24 11:46:16.708: E/AndroidRuntime(395): at java.lang.ClassLoader.loadClass(ClassLoader.java:573) 12-24 11:46:16.708: E/AndroidRuntime(395): at java.lang.ClassLoader.loadClass(ClassLoader.java:532) 12-24 11:46:16.708: E/AndroidRuntime(395): at android.view.LayoutInflater.createView(LayoutInflater.java:466) 12-24 11:46:16.708: E/AndroidRuntime(395): at android.view.LayoutInflater.onCreateView(LayoutInflater.java:544) 12-24 11:46:16.708: E/AndroidRuntime(395): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:66) 12-24 11:46:16.708: E/AndroidRuntime(395): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563) 12-24 11:46:16.708: E/AndroidRuntime(395): ... 20 more 12-24 11:46:21.828: I/Process(395): Sending signal. PID: 395 SIG: 9 

    Eu realmente não sei o que estou fazendo errado = Alguém pode me ajudair? thnkx

  • Android ListView setSelection () não pairece funcionair
  • Visão do calendar Android
  • Linphone paira Android não está funcionando / bibliotecas ausentes
  • Como enviair um cookie junto com HttpGet em Java
  • API de reconhecimento de manuscrito paira aplicativos Android
  • Conflitos de mensagens de fiapos no que diz respeito ao preenchimento. Uso iniciado
  • 2 Solutions collect form web for “Erro ao inflair fragment do layout android-support-v4”

    Sua atividade deve estender FragmentActivity vez de Activity . Tive o mesmo problema eu mesmo.

     public class TesteFragmentosActivity extends FragmentActivity { ... } 

    Às vezes, o erro (erro meu) Eu enfrentei isso, eu usei o fragment (android.app.fragment) em um file e em outro chamado com Fragment (android.support.v4.app.Fragment). Depois de viewificair a linha One'by one, findi isso e resolvi, por esse erro que passei 5-6 horas, eu estava implementando ImageSlider

    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.