troubleshooting Question

recyclerview and cardview appear only on nexus 5 23 API emulator

Avatar of derrida
derrida asked on
AndroidJava
3 Comments1 Solution498 ViewsLast Modified:
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>

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>

any idea?
ASKER CERTIFIED SOLUTION
KRUNAL TAILORFreelance Mobile Developer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Top Expert 2014

The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.

Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros