可能重复:
Hackbook sample code to Fetch List of Current Month Facebook Friends Birthdays
我制作了一个程序,其中获取我所有的 Facebook好友列表 ..
现在我想让我的模块更多为用户定制并希望允许用户查看他们的朋友列表月明智
问题:
How to sort Facebook Friends List those birthdays in Current Month or Week only...
获取所有朋友列表的代码:
public static void requestFriends(FacebookRequest facebookRequest) {
Log.d(LOG_TAG, "requestFriends(" + ")");
String query = "select name, birthday, uid, pic_square from user where uid in (select uid2 from friend where uid1=me()) order by birthday_date";
Bundle params = new Bundle();
params.putString("method", "fql.query");
params.putString("query", query);
FacebookUtility.asyncRunner.request(null, params,
new FacebookRequestListener(FacebookRequestListener.FRIENDS, facebookRequest));
}
获取1月份生日那些朋友列表的代码:
String query = "select name, birthday, uid, pic_square from user where uid in (select uid2 from friend where uid1=me())AND birthday_date >= '01/01' AND birthday_date <= '01/31' ORDER BY birthday_date ASC";
答案 0 :(得分:0)
根据我的理解,您已经知道如何从特定月份结交朋友。 虽然我不知道android我相信你只需要获取当前月份并将其插入到fql中。
Calendar c = Calendar.getInstance();
int month = c.get(Calendar.MONTH)
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";
或类似的东西。