我正在使用facebook登录我的android应用程序,现在在MYSQL数据库中创建一个用户,我想知道用户第一次登录应用程序的时间。
例如,当我们授权应用程序使用facebook基本信息时。
谢谢:)
编辑:我使用Facebook的登录按钮(<com.facebook.widget.LoginButton... />)进行登录&当状态发生变化时,我将获取用户详细信息,使用
onSessionStateChange(SessionState state, Exception exception){...}发布于 2012-12-11 18:19:20
您需要在名为"Shared Preferences“的东西中存储该应用程序以前是否运行过。您可以使用类似下面的内容
SharedPreferences prefs = this.getPreferences(Context.MODE_PRIVATE);
if(prefs.contains(HAS_BEEN_RUN_FLAG)){
//check the database for the user info
}
else{
//do the facebook authentication
prefs.edit().putInt(HAS_BEEN_RUN_FLAG, 1).commit();
}https://stackoverflow.com/questions/13806059
复制相似问题