Android Learning Notes

Source: Internet
Author: User
<span id="Label3"></p><p><p><strong>14 Main Components</strong> : activity,service,broadcastreceiver,contentprovider,intent</p></p><p><p>Intent message body function: the transfer of data from one interface to another interface needs to use</p></p><p><p><strong>2 Layout Manager:</strong></p></p><p><p>Linear Layout: Android.widget.LinearLayout<br>Absolute Layout: Android.widget.AbsoluteLayout<br>Table Layout: Android.widget.TableLayout<br>Frame Layout: Android.widget.FrameLayout<br>Relative Layout: Android.widget.RelativeLayout</p></p><p><p>View subclass, ViewGroup can act as a container for other controls</p></p><p><p><strong>3.Java of four internal classes:</strong></p></p><p><p>http://blog.csdn.net/qq435757399/article/details/7037007</p></p><p><p><strong>4.java class Name. This</strong></p></p><p><p>This refers to the object that is currently accessing this code, when using this in an inner class is the object of the inner class,<br>In order to access the outer class object, you can use the outer class Name. this to access, and generally only in this case use this</p></p><pre><span style="color: #0000ff;"><span style="color: #0000ff;"></span> public</span> <span style="color: #0000ff;"><span style="color: #0000ff;">class</span></span>Activity01<span style="color: #0000ff;"><span style="color: #0000ff;">extends</span></span><span style="color: #000000;"><span style="color: #000000;">activity{</span></span><span style="color: #0000ff;"><span style="color: #0000ff;"></span> public</span> <span style="color: #0000ff;"><span style="color: #0000ff;">void</span></span><span style="color: #000000;"><span style="color: #000000;">onCreate (Bundle Savedinstancestate) {</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">Super</span></span><span style="color: #000000;"><span style="color: #000000;">. OnCreate (savedinstancestate); </span></span><span style="color: #008000;"><span style="color: #008000;">/*</span></span><span style="color: #008000;"><span style="color: #008000;">Setting the display main.xml layout</span></span><span style="color: #008000;"><span style="color: #008000;">*/</span></span><span style="color: #000000;"><span style="color: #000000;">Setcontentview (r.layout.main); </span></span><span style="color: #008000;"><span style="color: #008000;">/*</span></span><span style="color: #008000;"><span style="color: #008000;">Findviewbyid (r.id.button1) Get button1 in Layout main.xml</span></span><span style="color: #008000;"><span style="color: #008000;">*/</span></span><span style="color: #000000;"><span style="color: #000000;">button Button</span></span>=<span style="color: #000000;"><span style="color: #000000;">(Button) Findviewbyid (r.id.button1); </span></span><span style="color: #008000;"><span style="color: #008000;">/*</span></span><span style="color: #008000;"><span style="color: #008000;">Monitor event information for a button</span></span><span style="color: #008000;"><span style="color: #008000;">*/</span></span><span style="color: #000000;"><span style="color: #000000;">Button.setonclicklistener (</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">New</span></span><span style="color: #000000;"><span style="color: #000000;">Button.onclicklistener () {</span></span><span style="color: #0000ff;"><span style="color: #0000ff;"></span> public</span> <span style="color: #0000ff;"><span style="color: #0000ff;">void</span></span><span style="color: #000000;"><span style="color: #000000;">OnClick (View V) {</span></span><span style="color: #008000;"><span style="color: #008000;">/*</span></span><span style="color: #008000;"><span style="color: #008000;">Create a new intent object</span></span><span style="color: #008000;"><span style="color: #008000;">*/</span></span><span style="color: #000000;"><span style="color: #000000;">Intent Intent</span></span>=<span style="color: #0000ff;"><span style="color: #0000ff;">New</span></span><span style="color: #000000;"><span style="color: #000000;">Intent (); </span></span><span style="color: #008000;"><span style="color: #008000;">/*</span></span><span style="color: #008000;"><span style="color: #008000;">specifies the class to start intent</span></span><span style="color: #008000;"><span style="color: #008000;">*/</span></span><span style="color: #000000;"><span style="color: #000000;">Intent.setclass (Activity01.</span></span><span style="color: #0000ff;"><span style="color: #0000ff;"></span> this</span>, Activity02.<span style="color: #0000ff;"><span style="color: #0000ff;">class</span></span><span style="color: #000000;"><span style="color: #000000;">); </span></span><span style="color: #008000;"><span style="color: #008000;">/*</span></span><span style="color: #008000;"><span style="color: #008000;">start a new activity</span></span><span style="color: #008000;"><span style="color: #008000;">*/</span></span><span style="color: #000000;"><span style="color: #000000;">startactivity (intent); </span></span><span style="color: #008000;"><span style="color: #008000;">/*</span></span><span style="color: #008000;"><span style="color: #008000;">Close the current activity</span></span><span style="color: #008000;"><span style="color: #008000;">*/</span></span><span style="color: #000000;"><span style="color: #000000;">Activity01.</span></span><span style="color: #0000ff;"><span style="color: #0000ff;"></span> this</span><span style="color: #000000;"><span style="color: #000000;">. Finish (); } }); }}</span></span></pre><p><p></p></p><p><p>Android Learning Notes</p></p></span>

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.