Passing data from Recycler view onClick to Detail Activity with android databinding
<p>I am having a list of items populating through recyclerview with android databinding technique and now I want to pass and populate the same data in detail Activity not getting the right thing to do such. So, kindly help to do this.</p>

<p>public class Fragment extends Fragment {</p>

<pre><code>private FirebaseRecyclerAdapter adapter;
private Firebase mFirebaseRef = new Firebase("https://xyz.firebaseio.com/category/").child("list");

public Fragment() {
    // Required empty public constructor
}

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
}

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    // Inflate the layout for this fragment
    final View rootView = inflater.inflate(R.layout.recycler_view, container, false);
    final RecyclerView recyclerView = (RecyclerView) rootView.findViewById(R.id.recycler_view);

    adapter = new FirebaseRecyclerAdapter&lt;List, ViewHolder&gt;List.class, R.layout.fragment,
            ViewHolder.class, mFirebaseRef) {
        @Override
        protected void populateViewHolder(ViewHolder viewHolder, List list, int i) {

            FragmentBinding binding = viewHolder.getBinding();
            binding.setList(list);
        }
    };
    recyclerView.setAdapter(adapter);
    recyclerView.setHasFixedSize(true);
    recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
    recyclerView.addItemDecoration(new DividerItemDecoration(getActivity(), null));
    return rootView;
}

public static class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener{

    public FragmentBinding binding;

    public ViewHolder(View itemView) {
        super(itemView);
        binding = DataBindingUtil.bind(itemView);
        itemView.setOnClickListener(this);
    }
    public FragmentBinding getBinding() {
        return binding;
    }

    @Override
    public void onClick(View v) {
        Intent intent = new Intent(v.getContext(), DetailedActivity.class);

        **// need help here**

        v.getContext().startActivity(intent);
    }
}


@BindingAdapter("quantity")
public static void setQuantityText(TextView view, int quantity) {
    view.setText(String.valueOf(quantity));
}
public static class Handlers {

    public  static void increment(View view, int max) {
        FragmentBinding binding = DataBindingUtil.findBinding(view);
        binding.setQuantity(Math.max(max, binding.getQuantity() + 1));
    }
    public static void decrement(View view, int min) {
        FragmentBinding binding = DataBindingUtil.findBinding(view);
        binding.setQuantity(Math.min(min, binding.getQuantity() - 1));
    }
}
</code></pre>

<p>}</p>

<pre><code>&lt;layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"&gt;

&lt;data&gt;
    &lt;variable
        name="List"
        type="com.xyz.www.android.model.List"/&gt;

    &lt;variable
        name="quantity"
        type="int"/&gt;

    &lt;variable
        name="Handlers"
        type="com.xyz.www.android.ui.fragments.Fragment.Handlers"/&gt;

&lt;/data&gt;

&lt;RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:paddingStart="@dimen/activity_horizontal_margin"
    android:paddingEnd="@dimen/activity_horizontal_margin"
    android:paddingTop="8dp"&gt;

        &lt;ImageView
            android:layout_width="76dp"
            android:layout_height="76dp"
            android:contentDescription="@string/content_description"
            app:imageUrl="@{List.productImageUrl}"
            android:padding="8dp"
            android:layout_gravity="center_horizontal|bottom"
            android:layout_marginTop="8dp" /&gt;


    &lt;LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:padding="8dp"
        android:layout_alignParentTop="true"
        android:layout_alignParentStart="true"
        android:layout_marginStart="72dp"&gt;


        &lt;TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@{List.productTitle}"
            android:textSize="16sp"
            android:textColor="@android:color/primary_text_light"
            app:font="@{`Roboto-Regular.ttf`}"/&gt;

        &lt;TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@{List.productSku}"
            android:textSize="13sp"
            android:paddingTop="8dp"
            app:font="@{`Roboto-Regular.ttf`}"/&gt;

        &lt;LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="horizontal"&gt;

            &lt;TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/Rs"
                android:textSize="14sp"
                android:paddingTop="8dp"
                android:paddingEnd="2dp"
                android:paddingStart="2dp"
                app:font="@{`Roboto-Regular.ttf`}"/&gt;

            &lt;TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@{List.productSellingPrice}"
                android:textSize="14sp"
                android:paddingTop="8dp"
                android:paddingStart="2dp"
                android:paddingEnd="2dp"
                android:textColor="@android:color/primary_text_light"
                app:font="@{`Roboto-Regular.ttf`}"/&gt;

        &lt;/LinearLayout&gt;
    &lt;/LinearLayout&gt;

    &lt;LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:layout_alignParentEnd="true"
        android:paddingTop="16dp"
        android:paddingBottom="16dp"&gt;


        &lt;Button
            style="?android:attr/buttonStyleSmall"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/decrease" /&gt;

        &lt;TextView
            android:layout_width="32dp"
            android:layout_height="wrap_content"
            app:font="@{`Roboto-Regular.ttf`}"
            app:quantity="@{quantity}"
            android:textAlignment="center" /&gt;

        &lt;Button
            style="?android:attr/buttonStyleSmall"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/increase" /&gt;

    &lt;/LinearLayout&gt;
    &lt;/RelativeLayout&gt;
</code></pre>

<p></p>

<pre><code>@JsonIgnoreProperties(ignoreUnknown=true)
</code></pre>

<p>public class List extends BaseObservable {</p>

<pre><code>String productTitle;
String productSku;
String productImageUrl;
String productDescription;
String productMrp;
String productSellingPrice;


public List() {
}

public List(String productTitle, String productSku,
                 String productImageUrl, String productDescription,
                 String productMrp, String productSellingPrice) {

    this.productTitle = productTitle;
    this.productSku = productSku;
    this.productImageUrl = productImageUrl;
    this.productDescription = productDescription;
    this.productMrp = productMrp;
    this.productSellingPrice = productSellingPrice;

}

@Bindable
public String getProductTitle() {
    return productTitle;
}

@Bindable
public String getProductSku() {
    return productSku;
}

@Bindable
public String getProductImageUrl() {
    return productImageUrl;
}

@Bindable
public String getProductDescription() {
    return productDescription;
}

@Bindable
public String getProductMrp() {
    return productMrp;
}

@Bindable
public String getProductSellingPrice() {
    return productSellingPrice;
}
</code></pre>