Java Official website Description of the Looper object:
public class Looperextends ObjectClass used to run a message loop for a thread. Threads By default don't have a message loop associated with them; To create one, call prepare () in the thread,
In Android development, view is the technology that we have to touch to show. Typically, as the view becomes more complex, the performance of the overall layout decreases. Here's a view that promotes layout performance in some scenarios, which is
The origin of the problemin the project, sometimes need to implement a picture carousel effect, used to show banner. At the same time, the picture can be looped, and there is a row of dots below to indicate which page the current carousel is on.
In the app picture's carousel display can say is the very common realization effect, its realization principle is only utilizes the Viewpager, then uses the handler each time to set the Viewpager CurrentItem to the current item position+1 can. Let's
Events triggered by touching (touch)
Android events: OnClick, onscroll,onfling, etc., are made up of many touch. The first state of touch is definitely action_down, which means that the screen is pressed. After that, the touch will have a follow-up
Permission Elevation method:One way:1, add android:shareduserid= "Android.uid.system" in the Manifest node in Androidmanifest.xml.2, add the program on the virtual machine can not be used directly. But you can compile it into apk with Eclipse.3,
The idea here is that I'm using the code to view the Android source code, so it doesn't match the original design idea of Google engineer 100% (or maybe 0%), but this article will certainly help you understand asynctask, or something you haven't
Its inheritance relationship is as follows:
Copy Code code as follows:
Java.lang.Object
Android.content.Context
Android.content.ContextWrapper
Android.app.Application
Operation Steps
Step 1, create the application subclass,
* Asynctask
It appears that the modified connect () method is available, but the way of this anonymous thread is flawed: first, the thread is expensive, and if each task is to create a thread, then the application is much less efficient; second,
First, let's take a look at the results of our final implementation today:
This is the rebound effect in iOS. Of course, if we want to achieve this effect in Android, it doesn't feel so stiff and rolls to the bottom or top. Of course
The use of
Widget Introduction
We can understand widgets as a widget (pendant) placed on the desktop, and we can easily do a variety of things directly on the desktop, such as playing music.
When we press the desktop long, we can see the widget option, as
When you use the mobile news client, there will be a discovery, most of the news clients will classify news, such as headlines, entertainment, sports, technology and so on, how to achieve this interface? This realization is actually very simple,
1 to realize fade animation
Implementing in a program can be done in the following ways
View view = new view (context);//Animation view
alphaanimation AA = new Alphaanimation (1.0f, 0.0f);//Create a Alphaanimation object , the gradient
sets
It's an interesting little thing: using a custom view drawing, drawing lines, and drawing lines that fade until they disappear. The effect is shown in the following illustration:
You can make a stroke of change with a property animation or a
Activities provides an easy to manage dialog box mechanism for creating, saving, and replying, such as Oncreatedialog (int), onpreparedialog (int, Dialog), ShowDialog (int), Methods such as DismissDialog (int), which, if used, will return the
First look at the effect chart:
Problem:
1. Drop down list (because you haven't seen this yet ...) )
2, the title bar display problems
3, the button to Enable settings
..........
Here's the code:
Layout Fragment_main (Issue 1)
This article realizes the scaling effect of the images in Android
First design layout:
The logical code is as follows:
public class Mainactivity extends activity {private ImageView iv1;
Private ImageView Iv2;
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