Activity.startactivities () is often used to start other activity in the middle of an application.
Textutils.isempty () Simple tool class for detecting whether it is empty.
Html.fromhtml () is used to generate an HTML parameter, which can be a string. Personally think it's not very fast, so I don't use it very often. (I say it is not often used to highlight this sentence: Please build spannable manually to replace html.fromhtml), but it's good for rendering text that gets from the Web.
Textview.seterror () is great when validating user input.
Build.version_codes This indicates the current version number, which is often used when dealing with compatibility issues. Click to see the different features of each version.
log.getstacktracestring () Convenient log class tools, methods LOG.V (), LOG.D (), LOG.I (), LOG.W (), and LOG.E () all print information to Logcat, Sometimes it is necessary to insert the error information into the database or a custom log file, then this will need to return the error message as a string, that is, when using the static string getstacktracestring (Throwable tr) method.
Layoutinflater.from () as the name implies, is used to inflate a layout, the parameter is the ID of layout. This person who often writes adapter will use more.
Viewconfiguration.getscaledtouchslop () uses the values provided in viewconfiguration to ensure that all touch interactions are uniform. The value obtained by this method indicates that the user's hand is sliding at this distance before it is determined to be slipping. Of course, this value can also be determined by itself. But for consistency, it's better to use standard values.
Phonenumberutils.convertkeypadletterstodigits as the name implies. Converts letters to numbers, similar to T9 input methods,
Context.getcachedir () Gets the path to the cached data folder, very simple but not many people know, this path is usually on the SD card (here the SD card refers to the generalized SD card, including external storage and internal storage) adnroid/data/your application package name/ cache/below. When testing, you can go to see if the cache is successful. The advantage of caching here is that you don't have to manually create a folder yourself, you don't have to worry about deleting the folder you created, and when the application unloads, it will be emptied, and when the third-party cleanup tool is used, it will be emptied.
Argbevaluator the gradient used to process the color. As Chris Banes says, this class does a lot of auto-boxing, so it's best to get rid of its logic and implement it yourself. This is useless, unclear why, back to add.
Contextthemewrapper makes it easy to modify the theme when running.
Space space is a new control in Android 4.0 that can actually be used to separate different controls, which form a blank area. This is a lightweight view component that skips draw and is great for any scene that requires a placeholder.
Valueanimator.reverse () This method can smoothly cancel a running animation.
Original address:
http://www.zhihu.com/question/33636939#answer-18276269
1, the Throwable interface in the Getstacktrace () method, according to this method can get the function of the layer by call address, its return value is stacktraceelement[];
2, Stacktraceelement class, of which four methods GetClassName (), GetFileName (), Getlinenumber (), Getmethodname () in the debug program to print log is very useful;
3, Uncaughtexceptionhandler interface, again good code exception unavoidably, using this interface can handle uncaught exception;
4, the Resources class Getidentifier (name, Deftype, Defpackage) method, according to the resource name to obtain its ID, do the UI often used;
5, the View of the Isshown () method, used to be view.getvisibility () = = View.visible to judge (╯-╰);
6. The Aslist (T ... array) method in the arrays class, the array to the list of lists, in turn List.toarray ();
7, Android.text.format.Formatter class Formatfilesize (Context, long) method, used to format the file size (B→KB→MB→GB);
8, Android.media.ThumbnailUtils class, used to obtain the media (image, video) thumbnail;
9. Format (string, Object ...) in the String class method, used to format the string in Strings.xml (Xie @droider an hint: getstring (int, Object ...) in the context class. Method is more convenient to use);
10, the view class three methods: Callonclick (), PerformClick (), Performlongclick (), used to trigger the view of the Click event;
11. The IsEmpty (string) method in the Textutils class to determine whether the string is null or "";
12. Append (String) method in TextView class, add text;
13, the View Class Getdrawingcache () and so on a series of methods, currently only know can be used;
14, DecimalFormat class, used for string formatting including the specified number of bits, percentages, scientific counting method;
15, the System class Arraycopy (SRC, Srcpos, dest, Destpos, Length) method, used to copy the array;
16, the fragment class in the Onhiddenchanged (Boolean) method, using the fragmenttransaction in the Hide (), show () as if the other life-cycle method of fragment will not be called, too pit Dad!
17. Onwindowfocuschanged (Boolean) method in activity class;
18. The Getlocationinwindow (int[]) method in the view class and the Getlocationonscreen (int[]) method to get the view position in the window/screen;
19, TextView Class of Settransformationmethod (Transformationmethod) method, can be used to achieve "display password" function;
20, Textwatcher interface, used to monitor the text input box content changes;
21, the View Class SetSelected (Boolean) method combined with android:state_selected= "" To achieve the picture selection effect;
22, Surface Settings transparent: Surfaceview.setzorderontop (TRUE);
Surfaceview.getholder (). SetFormat (pixelformat.translucent); but will block other controls;
23. The Setfastscrollenabled (Boolean) method in the ListView or GridView class is used to set whether the Quick scroll slider is visible, but only if the item is sufficient;
24, Pagetransformer interface, use to customize the Viewpager page to switch animation, with Setpagetransformer (Boolean, Pagetransformer) method to set;
25. Apache offers a range of jar packages: Commons-lang.jar,commons-collections.jar,commons-beanutils.jar, many of which may have been implemented with several hundred lines of code, but may be much less efficient to perform, such as : Arrayutils,stringutils ... ;
26, Androidtestcase class, Android unit test;
27. The Onnewintent (Intent) method in activity class.
What are the methods, classes, or interfaces that make you feel brief encounter in Android development?