Yes I have. I already retrieve the data when the date is the same on the 
today's date. But when the date is weekly no data retrieve

On Saturday, December 3, 2016 at 1:32:16 AM UTC+8, Marina Cuello wrote:
>
> 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] 
> <javascript:>> 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] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> 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/5b156bbd-7560-46d3-9bc5-293dc5101052%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to