Q:

Why nothing is appearing on Screen and how to solve this issue while using RecyclerView in Android

after 2 hours of watching tutorial on RecyclerView I just stuck on the blank Screen. I just want that my code runs and I get the required Output. Also I need some information about cardView. Any help would be appreciated.
here is my code
Adapter.java
package bhanu13.flyourskills;

import android.content.Context;
import android.media.Image;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.TextView;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

public class Adapter extends RecyclerView.Adapter<Adapter.MyViewHolder> {

    private final LayoutInflater inflator;
    List<RowContent> data= Collections.emptyList();

    public Adapter(Context context,List<RowContent> data) {
        this.data=data;
       inflator=LayoutInflater.from(context);
    }

    @Override
    public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view=inflator.inflate(R.layout.one_row,parent,false);
        MyViewHolder myViewHolder=new MyViewHolder(view);
        return myViewHolder;
    }

    @Override
    public void onBindViewHolder(MyViewHolder holder, int position) {

        holder.firstImageButton.setBackgroundResource(R.drawable.himi);
        holder.secondImageButton.setBackgroundResource(R.drawable.himi);
        holder.textView.setText("A");

    }

    @Override
    public int getItemCount() {
        return data.size();
    }
    class MyViewHolder extends RecyclerView.ViewHolder
    {
        ImageButton firstImageButton;
        ImageButton secondImageButton;
        TextView textView;

        public MyViewHolder(View itemView) {
            super(itemView);
            firstImageButton= (ImageButton) itemView.findViewById(R.id.first_image_button);
            secondImageButton= (ImageButton) itemView.findViewById(R.id.second_image_button);
            textView= (TextView) itemView.findViewById(R.id.textview);
        }
    }
}

Fregment's code
package bhanu13.flyourskills;

import android.app.Fragment;
import android.content.Context;
import android.graphics.Point;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.LinearLayout;

import java.util.ArrayList;
import java.util.List;

public class ButtonsFregment extends Fragment {
    RecyclerView recyclerView;
    Adapter adapter;
    ImageButton firstImageButton;
    ImageButton secondImageButton;
    Context context;
    private List<RowContent> data;

    public ButtonsFregment() {
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_buttons_fregment, container, false);
        recyclerView= (RecyclerView) view.findViewById(R.id.recycler_view);
        adapter=new Adapter(getActivity(),getData());
        recyclerView.setAdapter(adapter);
        recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
        return view;
    }

    public List<RowContent> getData() {
        List<RowContent> rowContents=new ArrayList<>();
        RowContent rowContent=new RowContent();
        rowContent.firstImageID=R.drawable.himi;
        rowContent.secondImageID=R.drawable.himi;
        rowContents.add(rowContent);

        return rowContents;
    }
}

One_row.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal">

    <ImageButton
        android:id="@+id/first_image_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

    <ImageButton
        android:id="@+id/second_image_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="dummy"
        android:id="@+id/textview"/>

</LinearLayout>

and Fragment's xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".ButtonsFregment">
<android.support.v7.widget.RecyclerView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:id="@+id/recycler_view">
</android.support.v7.widget.RecyclerView>
</RelativeLayout>

MainActivity.java
package bhanu13.flyourskills;

import android.app.Fragment;
import android.app.FragmentTransaction;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;

public class MainActivity extends AppCompatActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);
        for (int i = 0; i < 4; i++) {
            Fragment buttonsFragment = new ButtonsFregment();
            FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction();
            fragmentTransaction.add(R.id.linear_fragments, buttonsFragment).commit();
        }
    }
}

A:

Activity 
package com.example.usmank.myapplication;

import android.app.ProgressDialog;
import android.os.Handler;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ProgressDialog pd=new ProgressDialog(this, ProgressDialog.STYLE_SPINNER);
        pd.show();
        FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
        fragmentTransaction.add(R.id.framLayout,new YourFragment());
        fragmentTransaction.commit();
        if(pd.isShowing()) {
        pd.dismiss();
        }
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_main, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();

        //noinspection SimplifiableIfStatement
        if (id == R.id.action_settings) {
            return true;
        }

        return super.onOptionsItemSelected(item);
    }
}

fragment
package com.example.usmank.myapplication;

/**
 * Created by usmank on 3/8/2016.
 */
import android.content.Context;
import android.graphics.Point;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.LinearLayout;

import java.util.ArrayList;
import java.util.List;

 public class YourFragment extends Fragment {
    RecyclerView recyclerView;
    Adapter adapter;
    ImageButton firstImageButton;
    ImageButton secondImageButton;
    Context context;

    public YourFragment() {
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_buttons_fragment, container, false);
        recyclerView= (RecyclerView) view.findViewById(R.id.recycler_view);
        adapter=new Adapter(getActivity());
        recyclerView.setAdapter(adapter);
        recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
        return view;
    }

}

adapter
package com.example.usmank.myapplication;

/**
 * Created by usmank on 3/8/2016.
 */
import android.content.Context;
import android.media.Image;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.TextView;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

public class Adapter extends RecyclerView.Adapter<Adapter.MyViewHolder> {

    private final LayoutInflater inflator;

    public Adapter(Context context) {
        inflator=LayoutInflater.from(context);
    }

    @Override
    public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view=inflator.inflate(R.layout.one_row,parent,false);
        MyViewHolder myViewHolder=new MyViewHolder(view);
        return myViewHolder;
    }

    @Override
    public void onBindViewHolder(MyViewHolder holder, int position) {

        holder.firstImageButton.setBackgroundResource(R.mipmap.ic_launcher);
        holder.secondImageButton.setBackgroundResource(R.mipmap.ic_launcher);
        holder.textView.setText("A");

    }

    @Override
    public int getItemCount() {
        //data.size()
        return 10;
    }
    class MyViewHolder extends RecyclerView.ViewHolder
    {
        ImageButton firstImageButton;
        ImageButton secondImageButton;
        TextView textView;

        public MyViewHolder(View itemView) {
            super(itemView);
            firstImageButton= (ImageButton) itemView.findViewById(R.id.first_image_button);
            secondImageButton= (ImageButton) itemView.findViewById(R.id.second_image_button);
            textView= (TextView) itemView.findViewById(R.id.textview);
        }
    }
}

fragment xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".ButtonsFregment">
    <android.support.v7.widget.RecyclerView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/recycler_view">
    </android.support.v7.widget.RecyclerView>
</RelativeLayout>

recycler xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal">

    <ImageButton
        android:id="@+id/first_image_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

    <ImageButton
        android:id="@+id/second_image_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="dummy"
        android:id="@+id/textview"/>

</LinearLayout>

activty xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
    android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity">

    <TextView android:text="@string/hello_world" android:layout_width="wrap_content"
        android:layout_height="wrap_content" />
    <FrameLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/framLayout">

    </FrameLayout>

</RelativeLayout>

gredle file
apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "com.example.usmank.myapplication"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:23.2.0'
    compile 'com.android.support:recyclerview-v7:23.1.1'
}

