The setting of the scene pattern should be quite familiar to everyone, but how do you set up a scenario pattern in Android with your own program, where you can use the system itself or customize it, but you may need to change the scenario pattern in
This article brings together 36 typical pieces of code for Android development, including making calls, sending text messages, waking the screen and unlocking them, whether there is a network connection, dynamic display, or hiding a soft keyboard,
It's a simple question, but it's always a bit of a problem to use after a certain amount of time. Here is a note of the Logcat steps:
1, in the activity to affirm the tag variable (name is actually casual, as follows:
private static final String
Most of the time you want to design a nice Android UI, the controls that you use with Android don't meet our needs. Consider customizing the control, display Class View in the Android interface, and implement our graph drawing by inheriting
First, hide the title bar
Copy Code code as follows:
Hide title bar this.requestwindowfeature (Window.feature_no_title);
Second, hide the status bar
Copy Code code as follows:
Hides the status bar This.getwindow (). SetFlags
1,android:orientation
Layout direction. Horizontal is to have all the child elements in the horizontal direction from left to right, vertical is to have all the child elements in the vertical direction from top to bottom in the arrangement.
The
Adapter in Android are useful when customizing display lists, such as Simpleadapter, whose constructors are:
Public Simpleadapter (context context, list> data, int resource, string[] from, int[] to)
The meaning of its various parameters:
1.context,
This example for you to share the Android wheel provinces and cities three-level linkage effect for your reference, the specific content as follows
On the GitHub, there is an open source control called Android-wheel, code address:
With the development of mobile hardware, Android's camera is becoming more and more powerful, and can find high resolution images.Some scenes need to be photographed and uploaded to the service, but because the size of the picture is too large, then
This article describes the Android programming memory overflow and prevention methods. Share to everyone for your reference, specific as follows:
The Android virtual machine is a register based Dalvik, and its maximum heap size is typically 16M.
Recently doing a project for Android Spinner use, here is a simple example to test how to use.
Spinner
is a drop-down list, drag a spinner control into the Android interface and set android:entries= "@array/spinner_data" in the propertyWhere
Objective
Lazy load, is when the fragment is completely visible when we go to load data, we do application development, one Activity may be viewpager (or other containers) with multiple fragment to use, and if each fragment need to load data, or
This example describes the Radiogroup usage of the Android Programming single option box. Share to everyone for your reference, specific as follows:
The group events for Radiogroup are described today. Radiogroup can be different radiobutton,
I've never noticed before. ListView's GetView will repeat several times, this time because the layout is more complex, so in the test time to breakpoint tracking, found that the same data repeatedly executed. Feel very strange, so the internet
If we need to set the touch vibration switch to open and remove the sliding unlock vibration effect, you need to make the following modifications.
In the Lockscreen method in the Lockscreen.java class
Copy Code code as follows:
else if
How do you judge a document? You can traverse the database by cursor, comparing the value of the Internal_content_uri field, which is a URI that holds the full path to the multimedia file on the Android phone's SD card.
[Java]
Copy Code code
First, the foreword:
I never put these things on my phone, but once I saw my colleague's Android phone, there is a QQ housekeeper floating on the desktop, colleagues drag the housekeeper, the housekeeper becomes a bird, the table below there is a
One of the most important mechanisms in Android is thread + messaging, which is not unique to Android, and, below, it's easy to say where you should pay attention when using threads.
We use the simplest way to build an Android thread + message
Sample code:
This is a code that reads the contact person:
Copy Code code as follows:
Package com.ui.domain;
Import java.util.ArrayList;
Import java.util.List;
Import android.app.Activity;
Import Android.database.Cursor;
Import
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.