See at other sites, Mark. 1. Recently opened apps are not displayed in the recent task list
Android:excludefromrecents= "true"
Set to true to exclude from the recent task list and not appear in the recent Tasks list
2. Infer whether a string str is null or is an empty string
Textutils.isempty (str)
3. How to use android:imeoptions= "Actionsearch|flagnofullscreen"
When you do a function that puts edittext into Actionbar as the search box, setting the EditText property to Android:imeoptions= "Actionsearch" encounters a problem. When you are on a horizontal screen. The width of the edittext will be filled out on the screen except for the soft keyboard, and the requirements do not match, changed to android:imeoptions= "Actionsearch|flagnofullscreen" after the OK.
4. How to change the brightness of the picture
1. Use Image.setcolorfilter (color.gray,porterduff.mode.multiply) to darken the image. Then use Image.clearcolorfilter (); Clear the filter to revert to the original brightness.
1. function
int brightness =-80;
ColorMatrix matrix = new ColorMatrix ();
Matrix.set (New float[] {1, 0, 0, 0, brightness, 0, 1, 0, 0,
Brightness, 0, 0, 1, 0, brightness, 0, 0, 0, 1, 0});
V.setcolorfilter (new Colormatrixcolorfilter (matrix));
But such a method would make the color less normal. The picture is left with a black edge.
5. Using handler to realize the inference of time interval events
See the Gesturedetector.java in Android is inferred by clicking and double clicking to implement gestures with the following code:
public boolean ontouchevent (motionevent ev) {... case MotionEvent.ACTION_DOWN:if (mdoubletaplistener ! = null) {Boolean hadtapmessage = Mhandler.hasmessages (TAP); if (hadtapmessage) mhandler.removemessages (TAP); if (mcurrentdownevent! = null) && (mpreviousupevent! = null) && hadtapmessage && Isconsidereddoubletap (mcurrentdownevent, mpreviousupevent, Ev)) {//This is a second tap Misdoubletapping = true; Give a callback with the first tap of the Double-tap handled |= Mdoubletaplistener.ondoubletap (mcurr Entdownevent); Give a callback with down event of the Double-tap handled |= mdoubletaplistener.ondoubletapevent (EV) ; } else {//This is a first tap mhandler.sendemptymessagedelayed (tap, Double_tap_tim EouT); } } ......} Private Boolean Isconsidereddoubletap (Motionevent firstdown, motionevent firstup, motionevent seconddown) { if (!malwaysinbiggertapregion) {return false; } final Long deltatime = Seconddown.geteventtime ()-firstup.geteventtime (); if (Deltatime > Double_tap_timeout | | deltatime < double_tap_min_time) {return false; } int deltax = (int) firstdown.getx ()-(int) seconddown.getx (); int deltay = (int) firstdown.gety ()-(int) seconddown.gety (); Return (DeltaX * deltax + deltay * DeltaY < Mdoubletapslopsquare); } private class Gesturehandler extends Handler {Gesturehandler () {super (); } gesturehandler (Handler Handler) {super (Handler.getlooper ()); } @Override public void Handlemessage (Message msg) {switch (msg.what) {case SHOW_PR Ess:Mlistener.onshowpress (mcurrentdownevent); Break Case Long_press:dispatchlongpress (); Break Case TAP://If the user's finger is still down, does not count it as a tap If (mdoubletaplist Ener! = null) {if (!mstilldown) {mdoubletaplistener.onsingletapconfirmed (Mcurr Entdownevent); } else {Mdeferconfirmsingletap = true; }} break; Default:throw new RuntimeException ("Unknown message" + msg); Never}}
detailed to be able to participate inSource, here is the magical mhandler.sendemptymessagedelayed. Let's say Mhandler sent the TAP message within the double_tap_timeout time. Just click on the time, assuming that the time is not sent out, that is, double-click the event.
Android app development often uses knowledge