Hi! Are you calling recyclerView.setLayoutManager(somelayout) somewhere
outside the code you pasted?

"In contrast to other adapter-backed views such as ListView
<https://developer.android.com/reference/android/widget/ListView.html> or
GridView
<https://developer.android.com/reference/android/widget/GridView.html>,
RecyclerView allows client code to provide custom layout arrangements for
child views. These arrangements are controlled by the
RecyclerView.LayoutManager
<https://developer.android.com/reference/android/support/v7/widget/RecyclerView.LayoutManager.html>.
A LayoutManager must be provided for RecyclerView to function."

Marina

On Fri, Dec 2, 2016 at 2:06 PM, Chie Paliza <[email protected]> wrote:

> Im creating budgeting app. And I want to see the expenses of the user
> weekly but I have a problem, Im getting first the date and compare it in
> the dates in that week but no data
> shown in my recyclerview. This is my code:
>
> recyclerView.requestLayout();
>     Log.e("myFirebaseData", "'" + month);
>     adapter.cleanup();
>
>
>         adapter = new FirebaseRecyclerAdapter<ExpenseData, myViewHolder>(
>                 ExpenseData.class, R.layout.listitem, myViewHolder.class, 
> mRef.orderByChild("date")) {
>
>
>             @Override
>             protected void populateViewHolder(final myViewHolder viewHolder, 
> ExpenseData model, final int position) {
>
>
>                            java.util.Calendar c = Calendar.getInstance();
>                             DateFormat format = new SimpleDateFormat("MMMM 
> dd, yyyy", Locale.ENGLISH);
>                             c.setFirstDayOfWeek(Calendar.SUNDAY);
>                             c.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);
>
>
>                             String[] days = new String[7];
>                             for (int i = 0; i < 7; i++) {
>                                 Log.e("dateTag", format.format(c.getTime()));
>                                 days[i] = format.format(c.getTime());
>                                 c.add(Calendar.DAY_OF_MONTH, 1);
>
>                                 String checkDate = model.getDate();
>                                 if (checkDate.contentEquals(days[i])) {
>
>
>                                     
> viewHolder.DateText.setText(model.getDate());
>                                     
> viewHolder.ExpenseTitleText.setText(model.getExpensetitle());
>                                     
> viewHolder.AmountText.setText(String.valueOf(String.format("%.2f", 
> model.getAmount())));
>                                 }
>                             }
>                     }
>
>         };
>
>
>     recyclerView.setAdapter(adapter);
>
>
> }
>
> --
> You received this message because you are subscribed to the Google Groups
> "Android Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/android-developers.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/android-developers/5c519fcd-837b-46d1-b0f2-
> 51b73fda5098%40googlegroups.com
> <https://groups.google.com/d/msgid/android-developers/5c519fcd-837b-46d1-b0f2-51b73fda5098%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/CACaNmX1z%3DcKi575-eQyripmpMT_OyDVWRJFx9SF-v4x-23%3DV0A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to