Android provides the invalidate method to refresh the interface, but invalidate cannot be called directly in the thread, because it violates the single-thread model: Android UI operations are not thread-safe, these operations must be called in the
Sometimes, our pages may contain some la S. These la s are hidden by default. After a user triggers some operations, the hidden la s are displayed. For example, an activity is used to display the list of friends. After you click "import" in the menu,
In the development of android applications, you sometimes need to restrict horizontal and vertical screen switching. You only need to add the android: screenOrientation attribute restriction to the AndroidManifest. xml file.
Ndroid:
If you are not satisfied with the UI control provided by the Android system, you can try the custom control. Let's take the Button as an example, android has previously written the Android Button control beautification method, which mentions the xml
Android is very popular now. Its So-called openness and free open source have attracted a large number of mobile phone hardware manufacturers to enter the Android camp. Another reason for its popularity is its platform application development. As
I. Windows:The following software must be installed in a Windows development environment:
Java JDK
Apache ANT Build System
Android SDK
Cygwin
Android NDK
Eclipse IDE
1. install Java
When there is a large amount of data in the database, you should note that Using Cursor for query may cause performance problems. The database query Cursor is managed by a CursorWindow, including memory space application and data filling.
Handler is a class used to operate message queues within a thread. This is a bit difficult. Let's talk about it slowly. As mentioned in the previous article, logoff is used to create a message queue for a thread. That is to say, logoff can make
Dialog is a control that is required by any system. It is used as an auxiliary window to display some messages or to request the user to take an action.
It is no exception in Android. For more information, see the document.
Precautions for use1.
1. Declare a system configuration change event for the ActivitySystem configuration change events refer to screen conversion, regional language changes, screen size changes, and so on. If the Activity does not declare to handle these events, the
In Android development, the timer generally has the following three implementation methods:
I. Use the Handler and thread sleep (long) Methods
2. Use the postDelayed (Runnable, long) method of Handler
3. Handler, timer, and TimerTask
Next we will
Having nothing to worry about, pondering the gesture interaction in Android, I found that there are not many articles on gestures on the Internet, and many references are of little value. This blog post is shared with you. In view of the fact that I
Now we have an Android Project. We want to expand the function of A, but do not want to develop on the basis of A, So we created another Android Project B and wanted to reference A in B.
One idea is to make project A pure Jar package so that other
The following are two encapsulated classes for image cutting. For reference and learning only.
One is the ImagePiece class, which stores a Bitmap object and an int variable that identifies the ordered index of the image.
Copy codeThe Code is as
First, users may regard this practice as a rogue software. Most of the time, programmers do not want to turn the software into rogue software. No way, the leaders have the say.
When using some Android applications, we may find that some services
This is a framework, but it is not that complicated. It is just a base class that is easy to expand. But at least it is framework code.
Copy codeThe Code is as follows: package arui;
Import android. app. Activity;Import android. OS. Handler;Import
Otherwise, Android is especially open. In Android development, this requirement can be achieved by sending a broadcast.
Here is a piece of encapsulated code.
Copy codeThe Code is as follows: public class ShortcutUtil {
Public static void
Generally, programs are written under the pressure of the Project Plan. The Code completed at this time can complete the specific business logic, but the performance is not necessarily optimized. Generally, excellent programmers constantly rebuild
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