Android a little bit of knowledge

Source: Internet
Author: User

1. How to hide the title bar

Add Requestwindowfeature (Window.feature_no_title) to the OnCreate function in Android mainactivity, and be sure to add it in front of the Setcontentview.

Levels in 2.logcat

LOG.V ()----------->verbose (some small logs);

LOG.D ()----------->debug (for debugging programs);

LOG.I ()------------>info (print more important information to help analyze user behavior);

LOG.W ()----------->warn (print warning);

LOG.E ()------------->error (for printing errors);

3. Xmlns in the layout file refers to the XML namespaces;

4. The layout uses Layout_weight to proportionally assign the control (in LinearLayout);

5. In the Manifest.xml

A. Registering activities and changing permissions;

B. Change the program icon (icon) and program name (lable);

6. Use toasts in activities (the information disappears after a period of time, usually used for reminders);

General usage Toast.maketext (activity.this,string,toast.lenght_short). Show ();

Where activity refers to the class that invokes the Toast, string refers to the content you want to remind, Toast.lenght_short and Toast.lenght_long are rules for the duration of the reminder.

type definition of 7.progressBar;

<progressbar

........

style = "Android:attr/progressbarstyle ...."/>

Android a little bit of knowledge

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.