Open the app and decide if you want to use it for the first time.
1 Private voidBeforeinitmenu () {2AppContext AppContext =(AppContext) Getapplicationcontext ();3 4 if(Appcontext.isfirstlogin ()) {5 //first time start6 //If you start the first time, 5 boot images appear. 7Intent Intent =NewIntent ( This, Guideactivity.class);8 startactivity (intent);9}Else if(!Appcontext.islogin ()) {Ten //Check if login OneUihelper.showloginpage ( This); A}Else { - //Login Chat Server -Openfirelogintask task =NewOpenfirelogintask ( This, theAppcontext.getloginuid () + "", Appcontext.getlogininfo () - . GETPWD ()); - Task.execute (); - } + - //Network connection Judgment + if(!appcontext.isnetworkconnected ()) { AT.showlong ( This, r.string.network_not_connected); at } - - //open Baidu Push service - //log in as Apikey, typically in the oncreate of the main activity - pushmanager.startwork (Getapplicationcontext (), - Pushconstants.login_type_api_key, inApikeyutil.getmetavalue ( This, "Api_key")); - to //Check for new version + if(Appcontext.ischeckup ()) { -Updatemanager.getupdatemanager (). Checkappupdate ( This,false); the } * $ //register a message to receive a broadcastPanax NotoginsengIntentfilter filter =NewIntentfilter (); - filter.addaction (openfireconstant.new_message_action); the Registerreceiver (receiver, filter); + A}