An example of the implementation of the function is:1, after the installation program to look at an activity program interface, which has a button, click on the button will start a service services, at this time in the Setup program management will
Recently done a small thing encountered such a situation, I from a page mainactivity modify some content, need to jump to a new editactivity to do the modification, after the modification is completed to the previous mainactivity, because the
1, Toast Control:
By looking at the source code, it is found that the principle inside toast is to obtain a View object (TextView) by obtaining a Layoutinflater layout manager through a service context.layout_inflater_service. Set the content to
1. Preparation workAPK's signature work can be done in two ways:
1) The APK signature is completed by the graphical interface provided by ADT;Right key item--"Android tools--" Export signed Application package...--"Open graphical interface2
There are two kinds of context in Android, one is the application, the other is the context of activity, and we usually pass the activity context among various classes and methods.
Difference relation:
Copy Code code as follows:
Relativelayout
First Class: Property value is True or False
Android:layout_centerhrizontal Horizontal CenterAndroid:layout_centervertical Vertical CenterAndroid:layout_centerinparent is completely centered relative to the parent
To realize the system reboot, the APK need system permission, add android:shareduserid= "Android.uid.system" in Androidmanifest.xml, and then modify the signature;
Specific method Reference:
Click to open the link
1, using PowerManager to achieve:
Traditional way:
Copy Code code as follows:
public void backsms (view view) {
Let's say I've got all the text messages.
StringBuilder sb = new StringBuilder ();
Sb.append ("");
Sb.append ("");
for (Smsinfo Info:smsinfos) {
Recently encountered a question about the Android soft keyboard. Each item in the ListView has a edittext, in the last few item, EditText first click the interface can also eject up, normal display,
But the second click, the software disk will be
drawable animation can load drawable resources to implement frame animations. Animationdrawable is the basic class for implementing drawable animations.
Here, we use animationdrawable to simulate the implementation of the dynamic graph simply.
Record a very useful small control edittextwithdel, that is, add a small icon to the right of the Android input box, click on the small icon to clear the contents of the input box, because the Android native EditText does not have this function, So
Most of the Android system default activity between the animation switch effect is, the right slide into the left slide; sometimes our needs may be to require all activity to be switched to fade in, and this time you may need to change the default
Android Development adds left and right gesture recognition for the activity, such as sliding down the current page.
Copy Code code as follows:
/*
* For left and right gestures
* 1. Copy the following content to target activity
* 2.
The main points to use are as follows:
1. Use ListAdapter (general use of arrayadapter) for Autocompletetextview to provide data, if necessary can also overload GetView () to customize the display of list items. This step with ListView.2. If you
Custom controls are often used in recent projects, so custom attributes are often used, and here is a description of the use of custom attributes:
Custom attributes exist in the/value/attr.xml file and exist in the following format.
Copy Code
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