Function Description: log on to the application upon installation. When you Enable Automatic Logon, the application automatically enters the main interface.
Loginact. Java
Package COM. cards. activity; import android. app. activity; import android. content. intent; import android. content. sharedpreferences; import android. OS. bundle; import android. util. log; import COM. cards. commom. common; import COM. cards. commom. myApp; import COM. cards. r;/*** Note: Program portal (welcome page) ** @ author yazhizhao 2014-7-7 */public class welcomeact extends activity {private sharedpreferences sp; // temporary storage public locationclient mlocationclient = NULL; Public bdlocationlistener mylistener = new applocationlistener (); @ overridepublic void oncreate (bundle savedinstancestate) {super. oncreate (savedinstancestate); setcontentview (R. layout. act_welcome); // used to safely exit MyApp. getinstance (). addactivity (this); thread t = new thread (r); T. start (); // start the opening animation} // start the animation thread runnable r = new runnable () {private string account; private string PWD; @ overridepublic void run () {try {thread. sleep (3000);} catch (interruptedexception e) {// todo auto-generated catch blocke. printstacktrace ();} sp = getsharedpreferences ("common_data", mode_private); account = sp. getstring ("acount", ""); Pwd = sp. getstring ("PWD", ""); If (account = "" & Pwd = "") {// enter the login interface intent = new intent (welcomeact. this, loginact. class); startactivity (intent);} else {// directly go to the homepage intent = new intent (welcomeact. this, premieract. class); startactivity (intent) ;}finish () ;};@ overrideprotected void onstart () {// used to safely exit MyApp. getinstance (). addactivity (this); super. onstart () ;}@ overrideprotected void ondestroy () {common. destroyloading (welcomeact. this); finish (); super. ondestroy ();}}