1 Packagecom.example.ele_me.activity;2 3 ImportAndroid.annotation.SuppressLint;4 Importandroid.app.Activity;5 Importandroid.content.Intent;6 ImportAndroid.os.Bundle;7 ImportAndroid.view.View;8 ImportAndroid.view.View.OnClickListener;9 ImportAndroid.view.Window;Ten ImportAndroid.widget.TextView; One ImportCom.example.ele_me. R; A ImportCom.example.ele_me.util.InjectView; - ImportCom.example.ele_me.util.Injector; - the - //I would like to mention here that the first file that import entered is annotation, which is used to reflect the contents of the image, and there are usually three sub- items that are inherited from annotation: - //One is @override: it can only be used on the method, to tell others that this method is to change the parent. - + //One is @deprecated: when it is recommended that people do not use the old API, the editor will use the production warning message, can be set in the program of all elements. - + //One is @suppresswarnings: This type can temporarily shut down some warning messages. A at Public classWelcomeactivityextendsActivity { - @InjectView (R.id.welcome_start_order) - PrivateTextView start; -@SuppressLint ("Newapi") - //the above line is used to allow Android's high version compatible with the lower version - in @Override - protected voidonCreate (Bundle savedinstancestate) { to //TODO auto-generated Method Stub + Super. OnCreate (savedinstancestate); - requestwindowfeature (window.feature_no_title); the //Half Full Screen * $ Setcontentview (r.layout.welcome);Panax NotoginsengInjector.get ( This). inject ();//init views -Start.setonclicklistener (NewOnclicklistener () { the + @Override A Public voidOnClick (View v) { theIntent Intent =NewIntent (welcomeactivity. This, Homepageactivity.class); + startactivity (Intent); - finish (); $ //a very easy-to-understand listener, that is, when a button is received, intent will execute the command: from one page to another $ } - }); - the } - Wuyi the}
Wirelessly tutorial (6): Basic usage of annotation