There are times when developing and sometimes just want the user to be able to use the program only one day, or one months, or longer.
Void Limited () {
Time t = new Time (); or time T=new time ("gmt+8"); Add time zone information.
T.settonow (); Get the system time.
String time = T.year + "Year" + (T.month + 1) + "Month" + T.monthday + "Day"
+ T.hour + "h" + T.minute + "M" + t.second;
LOG.E ("MSG", time);
if (t.year = = && T.month + 1 = = 9 && T.monthday = = 23) test
if (t.year!=2014 | | (t.month+1)!=9)//this month
if (t.year!=2014 | | (t.month+1)!=9| | T.MONTHDAY!=23)//Today
{
Toast.maketext (Mainactivity.this, "Call release time to Auto-exit, please contact the software author qq:345139427",
Toast.length_long). Show ();
New Handler (). postdelayed (New Runnable () {//deferred execution
@Override
public void Run () {
Android.os.Process
. KillProcess (android.os.Process
. Mypid ()); Terminating a thread
}
}, 3000);
}
}
Android Developer copyright time limit when the time is available.