我有我所有 friend 的 Facebook ID。所以我只想在他们的墙上发布(消息和图片)。
这有可能吗?
我使用以下代码在我的墙上张贴
String res= UrltoValue.getValuefromUrl("https://graph.facebook.com/"+Login.facebookid+"/feed?access_token="+accesstoken+"&method="+"post"+"&message="+strFullMessage.replaceAll(" ", "%20")+"&source="+imageUrl);
我可以使用循环在多个 friend 墙上发帖吗?
我读到这样做是垃圾邮件。有没有做这种需求的应用?
请帮忙
谢谢
最佳答案
这是创建延迟的示例代码
首先在类级别创建一个计数器变量
public int counter = 0;
然后使用这段代码创建一个可重复的计数器
final int postCount = 100;
new Timer().schedule(new TimerTask() {
@Override
public void run() {
//Send message here ;
counter +=1;
if(counter>=postCount){
cancel();//stops the timer
}
}
}, 1000,3000);
第一个参数(1000)是定时器的启动延迟(以毫秒为单位),第二个(3000)参数用于设置每个重复运行 Action 之间的后续延迟。
关于android - 如何使用 Graph api 在多个 friend 墙上发帖?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13814949/