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
Copy Code code as follows:
public class Activity01 extends activity
{
/** called the activity is a. */
@Override
public void OnCreate (Bundle savedinstancestate)
{
Super.oncreate (savedinstancestate);
Setcontentview (R.layout.main);
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
Expandablelistview Introduction
Introduction of Expandablelistview
Expandablelistview can display a view to scroll vertically to show entries in the level two list, which is different from the list view (ListView). Expandablelistview allows two
When you refer to the local code should be based on the need for appropriate changes, there are redundant code small series did not delete. OK, nonsense not to say, everything let the code speak!
The key code looks like this:
The main code inside
The activity that needs to use the dialog style pop-up box is often encountered in Android, first of all, we might first think of setting the android:layout_height= "Wrap_content" attribute in the XML layout file. Let the activity be highly adaptive,
Using the Android Audiorecord to record PCM files, the Android SDK ensures that the sample frequencies supported on all devices are only 44100HZ,So if you want to get PCM data for other sampling frequencies, there are several ways:1. Try the
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.
In the Android program, typically, a menu of three vertical dots is displayed in the Actionbar when there are too many entries, but it is not shown when the real machine is tested, and the problem is found when the data is found and tested: If the
The original Android title bar color comparison monotonous, is a black lump, now assume your software needs to add the title bar alone, so not only beautiful but also can be added to the progress bar, how to achieve:
method One , in your activity,
Recently saw some applications when downloading files, and did not eject the progress bar, but very cool use the Start Download task button directly display the file download progress, by changing its background color, pushing from left to right,
Here is my implementation experience:
1. First of all, I am directly using alertdialog to achieve, OK, the shape is a bit ugly, and get dialog inside the control slightly trouble (because I have to do the landing box has a certain layout), and then
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