【问题标题】:List of all Upcoming Facebook Friends Birthdays in AndroidAndroid 中所有即将到来的 Facebook 好友生日列表
【发布时间】:2013-01-31 08:53:24
【问题描述】:

如何按即将到来的顺序获取 Facebook 好友的生日,例如:使用当前日期等显示列表中的顶部是接下来即将到来的生日

我仍然以 1 月到 12 月的形式过生日,让朋友在一月份的生日排在首位,在十二月的生日排在排位。

我也 在 1 月的生日就像 1 月 2 日或 1 月 28 日的生日一样

现在我只想看看下一个即将到来的生日列表,那些在列表底部去世的人......

喜欢这里:

https://itunes.apple.com/in/app/birthday-sweet-birthday-calendar/id367346406?mt=8

https://play.google.com/store/apps/details?id=com.scoompa.birthdayreminder&hl=en

他们在列表的顶部和底部显示了最近...

我仍然在使用这个查询:

    String query = "select name, birthday, uid, pic_square from user where uid in (select uid2 from friend where uid1=me()) order by birthday_date";

也试过这个代码:

 Calendar c = Calendar.getInstance(); 
    int month = c.get(Calendar.MONTH)+1;

    String query = "select name, birthday, uid, pic_square from user where uid in " +
    "(select uid2 from friend where uid1=me())AND birthday_date >= '" + month + "/01' AND birthday_date <= '" + month + "/31' ORDER BY birthday_date ASC";

【问题讨论】:

    标签: facebook android-facebook


    【解决方案1】:

    您可以根据生日对好友列表进行排序。喜欢,

    SELECT uid, name, birthday_date FROM user
    WHERE uid IN (SELECT uid2 FROM friend WHERE uid1=me())
    AND birthday_date >= CURRENT_DATE
    AND birthday_date <= LAST_DATE
    ORDER BY birthday_date ASC
    

    您可以在此处输入当前系统日期来代替CURRENT_DATE。因此,这将显示当前日期即将到来的生日。代替LAST_DATE,您可以使用要显示即将到来的生日的日期。

    【讨论】:

    • 哥们,我试过这个:Calendar c = Calendar.getInstance(); int 月 = c.get(Calendar.MONTH)+1; String query = "select name, birthday, uid, pic_square from user where uid in " + "(select uid2 from friend where uid1=me())ANDbirthday_date >= '" + month + "/01' ANDbirthday_date
    • 那么,您在 month 变量中得到了什么。是2(二月)吗?你知道二月没有任何31 日期。?您确定吗,您有一些朋友的生日在 2 月 1 日 到您使用的日期之间。?
    • 我连朋友列表都没有,请告诉我我应该写什么以及我在哪里做错了需要帮助的伙伴..
    • @Rakesh,不要惊慌,首先检查您在 month 变量中获得的值。尝试打印一些 Log 来检查它的值。
    • 再次感谢您的快速回复,好的伙计,我会尝试然后回复您,现在再次感谢...
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-07-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-08-06
    相关资源
    最近更新 更多