Brief Encounter methods, classes, or interfaces in Android development

Source: Internet
Author: User
<span id="Label3"></p><p><p>excerpt, finishing and personal summary, thanks to all participants!</p></p><p><p>1. The Getindentifier (name,deftype,defpackage) method in the resources category obtains its ID according to the resource rank;</p></p><p><p>2. Aslist (t...array) method in array class, array to list collection;</p></p><p><p>3. View class Callonclick (), PerformClick () and Performlongclick ();</p></p><p><p>4. Append method in TextView class, append text;</p></p><p><p>5. DecimalFormat class for string formatting, including the specified number of digits, percentages, and science and technology</p></p><p><p>6. Arraycopy (src,srcpos,dest,destpos,length) method in the System class for copy array;</p></p><p><p>7. The setfastscrollenabled (Boolean) method in the ListView or Grideview to set whether the Quick scroll slider is visible, provided that the item is sufficient;</p></p><p><p>8. GetParent (). Requestdisallowintercepttouchevent (true); deprive the parent view of the handling of the touch event, who knows Who.</p></p><p><p>9. Argbevaluator.evaluate (floatfraction, Object startvalue, object endvalue), used to generate a new color based on a starting color value and an end color value, and an offset. The minute implementation is similar to the bottom bar of sliding color gradients.</p></p><p><p>Palette,5.0 added a class that extracts the highlighted colors in a bitmap to get the theme Color.</p></p><p><p>viewdraghelper, customizing ViewGroup handling all kinds of events you're tired, huh? what the fuck!!</p></p><p><p>Fragmentmanager.enabledebuglogging () is helpful when you need to observe the Fragment State.</p></p><p><p>13.–nodpi, with no special definition, many modifiers (-mdpi,-hdpi,-xdpi, etc.) will automatically scale assets/dimensions by default, and sometimes we need to keep the display consistent, in which case we can use-nodpi.</p></p><p><p>Activity.recreate (), forcing the Activity to Rebuild.</p></p><p><p>Viewtreeobserver--this is a great Tool. You can enter into the view and monitor various states of the view structure, which I usually use to do the view measurement (often used in custom views).</p></p><p><p>Android:duplicateparentstate (view)-this method allows the child view to replicate the state of the parent View. For example, If a viewgroup is clickable, you can use this method to change the state of its sub-View when it is Clicked.</p></p><p><p>Android:tilemode (bitmapdrawable)--you can specify the pattern in which the picture uses a repeating fill.</p></p><p><p>Android:enterfadeduration/android:exitfadeduration (drawables)--this property can define the fade effect before it is displayed when the drawable has multiple states.</p></p><p><p>Android:scaletype (ImageView)--definition of how to scale/crop a picture in ImageView, the more commonly used is "centercrop" and "centerinside".</p></p><p><p>Sparsearray--map's Efficient and optimized Version. It is recommended to learn about sister sparsebooleanarray, Sparseintarray and Sparselongarray.</p></p><p><p>Activitymanager.clearapplicationuserdata ()--one-click Cleanup of user data generated by your app may be the easiest way to do the user exit login feature Ever.</p></p><p><p>22. Clear the contents of the Canvas: canvas.drawcolor (color.transparent, PorterDuff.Mode.CLEAR);</p></p><p><p>23. Clean up the view-related resources in the Ondetachedfromwindow method of the custom view;</p></p><p><p>Fragment receives callbacks in the Onattach method and implements fragment communication to the host Activity.</p></p><p><p>25. Use <span style="color:windowtext">clipdrawable</span> to implement the progress bar function;</p></p><p><p>26. Custom View GetContext (), no longer need to specifically create a Mcontext global object;</p></p><p><p>27. when customizing the handwriting view, pass the motionevent during finger movement <span style="color:windowtext">| </span>The Gethistorysize () of the Android developers object gets the historical point of the cache, and the curves drawn are much smoother.</p></p><p><p><br></p></p><p><p></p></p> <p style="font-size:12px;"><p style="font-size:12px;">Copyright Notice: This article for Bo Master original article, without Bo Master permission not Reproduced.</p></p> <p><p>Brief Encounter methods, classes, or interfaces in Android development</p></p></span>

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.