Error de Android inflar clase SwipeRefreshLayout
Estoy trabajando en una aplicación ahora que utiliza 3 pestañas con un fragmento en cada uno y estoy tratando de implementar SwipeRefreshLayout en cada uno de estos fragmentos. Creo que he creado esto correctamente, pero sigo recibiendo los errores:
android.view.InflateException: Binary XML file line #1: Error inflating class SwipeRefreshLayout Caused by: java.lang.ClassNotFoundException: Didn't find class "android.view.SwipeRefreshLayout" on path: DexPathList[[zip file "/data/app/com.ryan.brooks.fropllc.frop.app-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.ryan.brooks.fropllc.frop.app-1, /vendor/lib, /system/lib]] at com.ryan.brooks.fropllc.frop.app.whatsGoingOnFragment.onCreateView(whatsGoingOnFragment.java:23)
Ahora no tengo ni idea de lo que está causando esto. Si alguien pudiera ayudarme, sería tremendamente apreciado.
- Estilo SwipeRefreshLayout en r21 de la biblioteca de soporte
- Actualizar Actualización de Android Desplácese hasta actualizar
- SwipeRefreshLayout dentro de ViewPager
- Problemas al integrar EnhancedListView y SwipeRefreshLayout
- SwipeRefreshLayout sin animación en la creación de fragmentos
Aquí está mi diseño del fragmento donde estoy implementando el SwipeRefreshLayout:
<SwipeRefreshLayout android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/swipe_refresh_whats_going_on"> <ScrollView android:layout_width="match_parent" android:layout_height="match_parent" android:background="#343434"></ScrollView> </SwipeRefreshLayout>
Y aquí está mi clase de fragmentos en la que estoy llamando a SwipeRefreshLayout.
public class WhatsGoingOnFragment extends Fragment { private SwipeRefreshLayout swipeLayout; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment View view = inflater.inflate(R.layout.whats_going_on_fragment, container, false); // Retrieve the SwipeRefreshLayout and ListView instances swipeLayout = (SwipeRefreshLayout) view.findViewById(R.id.swipe_refresh_whats_going_on); // Set the color scheme of the SwipeRefreshLayout by providing 4 color resource ids swipeLayout.setColorScheme( android.R.color.holo_blue_bright, android.R.color.holo_green_light, android.R.color.holo_orange_light, android.R.color.holo_red_light); return view; } }
Tanto los diseños como la estructura de clase son los mismos para los 3 fragmentos con los cambios de nombre de ID. Realmente no tengo ni idea de lo que está pasando mal aquí. Nuevamente cualquier ayuda es muy apreciada!
- SwipeRefreshLayout detrás de ActionBar
- ¿Cómo configurar la vista de actualización personalizada en SwipeRefreshLayout?
- SwipeRefreshLayout + WebView cuando la posición de desplazamiento está en la parte superior
- SwipeRefreshLayout: Desplazar la animación de progreso
- SwipeRefreshLayout interferir con setOnScrollListener
- RecycleView se bloquea en Fragmento porque LayoutManager es NULL
- SwipeRefreshLayout - Tirar desde el fondo
- Cómo utilizar PullToRefresh en StaggeredGridView?
Necesita utilizar un nombre de paquete completo para SwipeRefreshLayout
:
<android.support.v4.widget.SwipeRefreshLayout android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.ryan.brooks.fropllc.frop.app.whatsGoingOnFragment" android:id="@+id/swipe_refresh_whats_going_on"> <ScrollView android:layout_width="match_parent" android:layout_height="match_parent" android:background="#343434"></ScrollView> </android.support.v4.widget.SwipeRefreshLayout>
- Android Studio: Creación de diseños de paisaje
- ¿Consigue la distancia entre dos ubicaciones en android?