[英]Android: How to display in-app update only once
Is it possible to display the flexible in-app update only once using just the Google API?是否可以仅使用 Google API 仅显示一次灵活的应用内更新? Eg.:
例如。:
Is it possible to achieve that with Google Core API or do I need to somehow store that information (that dialog was displayed but canceled) on my own?是否可以使用 Google Core API 来实现这一点,还是我需要以某种方式自行存储该信息(该对话框已显示但已取消)?
Use a flag using shared preferences like below.使用使用共享首选项的标志,如下所示。 Then check if the value has been edited before..if not app update
然后检查该值是否已被编辑过..如果不是应用程序更新
SharedPreferences sharedPref = getActivity().getPreferences(Context.MODE_PRIVATE);
SharedPreferences.Editor editor = sharedPref.edit();
editor.putBoolean("isAppUpdateShown", false);
editor.commit();
if(sharedPref.getBoolean("locked", false)){
//app update code
editor.putBoolean("isAppUpdateShown", true);
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.