1 Packagecom.mycompany.hungry;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 A ImportCOM.MYCOMPANY.R; - ImportCom.mycompany.util.InjectView; - ImportCom.mycompany.util.Injector; the - Public classWelcomeactivityextendsActivity { - @InjectView (R.id.welcome_start_order) - //Injectview is a highly sought-after ID method, equivalent to Findidbyview, which can save a lot of traditional codes. + PrivateTextView start; - //when we are going to call the change start in the future, we have to define the start from the start. + A@SuppressLint ("Newapi") at //@SuppressLint ("Newapi"). The Android version will be updated, and the new version brings new features to the new method. The new approach comes in handy, but it doesn't work on a low-version system, and if the compatibility is not right, the app will be crash on the lower version system. - @Override - protected voidonCreate (Bundle savedinstancestate) { - Super. OnCreate (savedinstancestate); - - requestwindowfeature (window.feature_no_title); in //full sentence use, syntactic meaning is full screen, but if it is to complete the full screen, you must write the following three sentences: - //requestwindowfeature (window.feature_no_title); to //GetWindow (). SetFlags (WindowManager.LayoutParams.FLAG_FULLSCREEN, + //WindowManager.LayoutParams.FLAG_FULLSCREEN); - Setcontentview (r.layout.welcome); theInjector.get ( This). inject (); * //Injector is another Java file. Init views $Start.setonclicklistener (NewOnclicklistener ()Panax Notoginseng //Start is a button system, now set the listener. - { the + @Override A Public voidOnClick (View v) { theIntent Intent =NewIntent (welcomeactivity. This, Homepageactivity.class); + //The type of the definition intent is the type of intention, and the intention here is to jump to another page from this page. - startactivity (Intent); $ //to execute the above instructions, you can not write. $ finish (); - } - }); the - }Wuyi the -}
wirelessly tutorial (1): @InjectView