Link to home
Create AccountLog in
Avatar of derrida
derrida

asked on

recyclerview and cardview appear only on nexus 5 23 API emulator

I am new to Android and Java. I have a navigation drawer with a list in it, and I have a RecyclerView with CardViews in it. It all shows up on the Nexus 5 with API 23, but when I try other emulators nothing appears: neither the list in the drawer, nor the cards.

In my Gradle file I have these dependencies:
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.android.support:design:23.2.1'
compile 'com.android.support:cardview-v7:23.2.0'
compile 'com.android.support:recyclerview-v7:23.2.0'

I do not get any errors, but my views still do not show up.

this is my activity_main.xml:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/drawer_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    tools:openDrawer="start">

    <include
        layout="@layout/app_bar_main"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

    <!-- app:menu="@menu/activity_main_drawer" -->
    <android.support.design.widget.NavigationView
        android:id="@+id/nav_view"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:fitsSystemWindows="true"
        app:headerLayout="@layout/nav_header_main"
         >

        <ListView
            android:id="@+id/munuList"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="#fff"
            android:layout_marginTop="160dp"
            >
        </ListView>

    </android.support.design.widget.NavigationView>

</android.support.v4.widget.DrawerLayout>

Open in new window


this is my content_main.xml:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    tools:context="com.example.ronsh.quoteme.MainActivity"
    tools:showIn="@layout/app_bar_main"
    android:background="#ccc">




    <android.support.v7.widget.RecyclerView
        android:id="@+id/cards_wrapper"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:scrollbars="vertical"
        android:background="#eeff99"/>




</RelativeLayout>

Open in new window


any idea?
Avatar of derrida
derrida

ASKER

i have tried in different devices with API 21 and 19, and even with others with API 23 and the same result. it only appears on the Nexus 5 API 23.
i have tried to change the gradle to API 19, 21, 22, and nothing.
anyone?
Avatar of derrida

ASKER

anyone?
ASKER CERTIFIED SOLUTION
Avatar of KRUNAL TAILOR
KRUNAL TAILOR

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account