Android can customize controls. Two custom controls have been recently exposed and can be reused later.
Public class AutoCompleteEmailEdit extends AutoCompleteTextView {Private ArrayList candidateString = null;Private ArrayAdapter adapter =
Notification n = new Notification (R. drawable. ic_launcher, "hello world", System. currentTimeMillis ());
This is the object for creating a Notification. One parameter is the icon, which is displayed on the top. The second parameter is the class
L Permission inmanifest:
L Save web Page tosdcard:
// Get file name
String fileName = webView1.copyBackForwardList (). getCurrentItem ()
. GetTitle ();
// Save file to sdcard
WebView1.saveWebArchive ("/sdcard /"
+ Environment. DIRECTORY_DOWNLOADS +
Activity Status:
Active: when an Activity is on the top of the stack, it is visible, focused, and user input acceptable. Android tries to maintain its Activity status as much as possible, killing other activities to ensure that the current Activity
The shutdown operation is triggered by a key. the linux kernel layer returns a key event to the android framework layer to go to the framework layer, and then executes the shutdown task of the kernel layer from the framework layer to the kernel
We often encounter a situation in our lives. Sometimes a text message is too long to send multiple messages. In fact, it is very easy to achieve this effect, just add a condition to judge, I will not write all the detailed steps here. I will only
Recently, many programs have created a floating box on the desktop to monitor the memory, or display the lyrics or something. The Code is as follows:
@ OverridePublic void onStart (Intent intent, int startId ){Super. onStart (intent, startId );//
In the Android Application Framework, there is a powerful event processing mechanism-Intent (Intent ). Intent functions much like events, but it differs from traditional event processing.
Traditional event processing focuses on handler triggering.
Intent is a very important concept in Android. Like the intention (Intent, purpose) of this term, the role of this class in Android is to call a build to do something, for example, startActivity is used to start an Activity, startService is used to
Public final boolean isAdded ()
If the Fragment object is added to its Activity, true is returned; otherwise, false is returned.
Public final boolean isDetached ()
If the Fragment has been explicitly separated from the UI, it returns true. That is,
I copied the method in andorid launcher and extracted it as follows:
[Java]Intent mainIntent = new Intent (Intent. ACTION_MAIN, null );MainIntent. addCategory (Intent. CATEGORY_LAUNCHER ); Final PackageManager packageManager = getPackageManager
The first thing that comes to the android source directory is probably to execute. build/envsetup. sh first to initialize some commands. Today, we mainly analyze envsetup. sh.
1. The command-that is, the function in envsetup. sh
Function help ()
[Java] @ OverridePublic Object onRetainNonConfigurationInstance (){Final List list1 = list;Return list1;}
The onSaveInstanceState is triggered during horizontal and vertical screen switching of Android, while the onRestoreInstanceState is
Android enables mp3 player to play music.
Intent it = new Intent (Intent. ACTION_VIEW ); Uri uri = Uri. parse (www.2cto.com ); It. setDataAndType (uri, "audio/mp3 "); StartActivity (it );Uri uri = Uri. withAppendedPath (MediaStore. Audio. Media.
[Java]Package smalt. music. utils; Import android. graphics. Bitmap;Import android. graphics. BitmapFactory;Import android. graphics. BitmapFactory. Options; // Three ways to attach an image:Public class BitmapUntil {// Directly merge the video into
During application development, you often need to draw a point of user-defined interest or custom Ry on the map. The base provided by RasterMap in the Road Map package is an image.
[Java]Protected void paint (Graphics g ){Map. paint (mapGraphics );G.
Share data with content providers
If you directly access a disk File (SDCard | File | SQLite database | preference), you need a lot of underlying interaction details. However, in this way, you can only access the application using URLs, unified Data
In the past two days, after programming the Android camera module and setting various parameters, we found that during previewing, the photos were reversed, rather than up or down, but 90 °. My mobile phone is Huawei U9200, with Android4.0.3 added
The performance optimization mentioned above is mainly for Java code optimization. This article shares the layout optimization. The layout optimization is based on the following principles:
1. Avoid unnecessary nesting. Do not place a layout in
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.