標題:
Android App - 設定使用限期 expiration date
[打印本頁]
作者:
admin
時間:
2012-2-20 11:19
標題:
Android App - 設定使用限期 expiration date
要為Apps 設下使用限期,可加入
protected void onResume()
{
super.onResume();
Calendar expirationDate = Calendar.getInstance();
expirationDate.set(2009,7,3);
//hardcoded expiration date,15th September would be: (2009, 8 , 15)
Calendar t = Calendar.getInstance();
//Calendar with current time/date
if (t.compareTo(expirationDate) == 1)
finish();
}
複製代碼
歡迎光臨 How2Do (http://forum.how2do.com.hk/)
Powered by Discuz! 7.2