Wirelessly tutorial (6): Basic usage of annotation

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.