1. Hide the title bar
Copy codeThe Code is as follows: // hide the title bar this. requestWindowFeature (Window. FEATURE_NO_TITLE );
Ii. Hide the status barCopy codeThe Code is as follows: // hide the status bar this. getWindow (). setFlags
Internet rumors that HTC's HERO-ROM supports multi-touch arguments mostly stem from browsing web pages and pictures, like the IPhone through gestures to control the size of the page. The following example uses the existing API to scale HERO images
When the screen changes to a horizontal screen, the system will call the OnCreate method of the current Activity again. You can put the following method in your OnCreate to check the current direction, then, let your SetContentView load different
When developing with AndroidNDK, it is annoying to create a local code folder, generate a local code file, and create a compilation file for the local code. Especially when implementing local methods, it is also annoying because the local method
Now there are more and more demands for maintaining and customizing Android, and more people are working on it. There are many bugs and unreasonable issues in the source code directly released by Google, especially native applications, such as Mms,
1) reclaim the Bitmap memory in time
The Bitmap class has a recycle () method. The method name indicates recycling. Here I have doubts. The Android system has its own garbage collection mechanism, which can occasionally recycle unused memory space,
It should be noted that, when the jar package and resource package are provided to third-party developers, the code of our project cannot be similar to R. layout. main, R. string. name and so on.
Therefore, we cannot directly use the R file. Instead,
In actual development, the most commonly used multi-touch technology is the zoom-in and zoom-out function. For example, some image browsers can use multiple fingers to zoom in or out the images on the screen. For example, Some browsers can also zoom
The ToggleButton status can only be selected or not selected, and different display text needs to be set for different states.
The following uses ToggleButton:
Directory structure
Main. xml layout FileCopy codeThe Code is as follows: Android:
@ Drawable/icon@: Represents R. javaDrawable: internal class drawableIcon: the object whose id is iconThe id of the drawable internal class in the R. java file is the constant corresponding to the icon value.
Android: label = "window title">
AppWidgetProvider is used to display plug-ins on the HOME page.
Steps:1. Provide AppWidget with an meta-layout file appwideprovider_provider.xml to display the Widget interface.2. Create a class that inherits from AppWidgetProvider and overwrite the
Tip:
Org. xmlpull. v1.XmlPullParserException: PI must not start with xml (position: unknown» timeout @ in java. io. InputStreamReader @ 47ec2770)
Org. xml. sax. SAXParseException: PI must not start with xml (position: unknown xm @ 3:5 in java. io.
To create a child View with a proportional size, you can set the width and height of LinearLayout to fill_parent, set the width or height of the Child View to 0, and then set different weights (weight) for the child View ), in this way, the size of
1. Use LinearLayout and RelativeLayout whenever possible. Do not use absolute layout.
2. Try dip and sp instead of px.
3. provide different layout files and images for different resolutions.
For example:
4. Set multi-resolution support in
In a recently written Android system, you need to request data from the web server. A login Activity will be sent to the MainActivity after logon. Both the logon and MainActivity need to request the jsonapi of php, so we have to keep the session in
Introduction
Recently, we have been studying Android deformation. Android 2D deformation (including scaling, distortion, translation, and rotation) can be achieved through Matrix, while 3D deformation can be achieved through Camera. Next we will
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