Need to ImageView show round pictures as follows Public StaticBitmap Toroundcorner (Bitmap Bitmap,floatratio) {System. out. println ("does the picture turn into a circular pattern +++++++++++++"); Bitmap Output=Bitmap.createbitmap (Bitmap.getwidth (), Bitmap.getheight (), Bitmap.Config.ARGB_8888); Canvas Canvas=NewCanvas (output); Final Paint Paint=NewPaint (); Final rect rect=NewRect (0,0, Bitmap.getwidth (), Bitmap.getheight ()); Final RECTF RECTF=N
:1. androidmainfest.xml file for intent configuration:2. Create a string action in the Activity--myaty.java that is started: public static final String ACTION = "Com.w.learnintent.intent.action.myaty";3, start the function code: StartActivity (New Intent (myaty.action)); Implicit intentIii. between different applications (implicit intent):1. Create another program by creating a new module on the basis of the original project.2, the original project androidmainfest.xml file for intent configu
Show Run Progress dialog box
We often have this experience: when running an application. You need to wait a while, and a progress (Please wait) dialog box is displayed to let the user know that the operation is in progress.
We continue to add code to the program in the previous article ~
1, add a button in the Activity_main.xml file of the previous article, add the following code for example:
2. Add a OnClick2 () method to the Ma
, otherwise also can not get, that is, setaccessible (true), meaning is accessible, this time to get the value of the current instance is not, just get the class inside a field information, the last sentence, Filed.get ( Object) is to get the current instance has the value of this field, of course, the display of the "year", you can operate on this, and I just need to hide it. There are some online look at some said through the layout of a layer to obtain, this method is not readable, and differ
input method is displayed on the window, then hide, or vice versa)
Inputmethodmanager IMM = (inputmethodmanager) getsystemservice (Context.input_method_service);
Imm.togglesoftinput (0, inputmethodmanager.hide_not_always);
2, Method Two (view is to accept the soft keyboard input views, show_forced means force display)
Inputmethodmanager IMM = (inputmethodmanager) getsystemservice (Context.input_method_service);
Imm.showsoftinput (view,inputmethodmanager.show_forc
Android hint hint font size modification, show full1. There is a problem in the work, that is, the custom EDITTEXT hint hint in the oversized font will be displayed,2. Then search the Internet for a moment, here to record, share to everyone, here to thank the Great God who wrote this3. The incoming hint is a spannedstring or spanned type, so you can keep the custom properties of the textImport android.text.
keyboard interactive mode.
Windowsoftinputmode has the following 10 values to choose from:
1.adjustNothing: window does not adjust
2.adjustPan: The contents of the current window will automatically move so that the current focus is never covered by the keyboard and the user can always see the input (the soft keyboard will block the screen)
3.adjustResize: The activity always adjusts the size of the screen to allow for soft keyboard space (you can display all screens)
4.adjustUnspecified: d
This article from: fair-jm.iteye.com, please specify the sourceThe official website of the tutorial is under the activity under the fragment in the Gold forum to find some ways to try to display but there will always be some problems after the switchFor example, after the switch is new, the map doesn't show up after the switch.This way I can keep the map state after switching, but I have to limit the screen to horizontal or vertical if the flip will a
interface, there is an account entry box and a password input box, need to hide the keyboard, the two input box objects placed in the Viewlist, as a parameter to the Hidesoftkeyboard method can be.The following method will pop up the hidden, hidden popup Public Static void Hidekeyboard () { = (Inputmethodmanager) Getsystemservice (context.input_method_service); Imm. Togglesoftinput (0, inputmethodmanager.hide_not_always);}See the API in detail:\androi
(MediaPlayer mp ){If (mLyricTimer. isRunging ()){MLyricTimer. stopTimer ();}If (mLyricPlayerListener! = Null ){MLyricPlayerListener. onStateChanged ();}Super. onCompletion (mp );}The last step is to inherit the two methods required by LyricAdapter. LyricListener. Send a notification from LyricAdapter to the logged-on mLyricPlayerLister. The reason for doing so is to make it easier for the caller to use it.@ OverridePublic void onLyricChanged (int lyric_index ){If (mLyricPlayerListener! = Null )
1. Under the Arabic language, take a picture of a motion path in camera,2. Slide into the gallery to view this picture, in the preview screen, the bottom right corner of the frame will have a "+" button, click on the button, and then press the Arabic button in the upper right corner, back to the motion trajectory animation preview screen3. Look at the trajectory animation, found that the first show is the green pattern, and then become the scene, gree
, always show half, the other item no problem, such as how to set up is useless1.2.2 The Click event set in the first item does not work, but a gentle scrolling of the Click event immediately takes effect.Ii. Solutions@Override PublicView GetView (intPosition, View Convertview, ViewGroup parent) {if(Convertview = =NULL){Convertview = Layoutinflater.from (Getactivity ()). Inflate (R.layout.fragment_feed_grid_item, parent,false);Convertview.setlayoutpa
before rewriting the code: Toast.maketext (Getapplicationcontext (), "test", Toast.length_long). Show ();After rewriting:looper.prepare (); Toast.makeText ( Getapplicationcontext (), "test", Toast.length_long). Show (); Looper.loop (); Generally, this problem is usually encountered if a new thread is not opened in the main thread. messagequeue. summary: The prerequisites for Toast display: 1:toa
Always thought that the shape of Android can draw straight lines, dashes, rectangles, circles, etc., Draw straight line also forget, with a view set the height and color, you can come out a straight line. So this is often not used for me, round is OK, see my application in the message prompt box is generated, OK, this does not exist, today want to do is a dashed line, nothing said, directly on the dotted line code:Explain the good perfect, really want
You need to modify the ListView class override Onintercepttouchevent () and ontouchevent ()//experiment with another method, overwriting the ontouchevent () of the drag icon in each row of the ListView, but the effect is not ideal. public class Mainactivity extends Activity {deleteadapter Deleteadapter;draglistview listview;boolean bflag;i Magebutton button; @Overridepublic void OnCreate (Bundle savedinstancestate) {super.oncreate (savedinstancestate); Setcontentview (r.layout.activity_main);d e
Android Development does not open the Data folder under the File Explorer when connecting to eclipse with a real machineAndroid Development does not open the Data folder under the File Explorer when connecting to eclipse with a real machine:The real machine first root, and then on the phone loaded R.E Manager (or similar software), the permissions of/data/data modified to read writable executable, then, you can expand in Eclipse. File Explorer Eclips
Android provides properties in the layout and can simply add animation effects, as follows:When you add a delete, hide, or display to a view in a layout, there will be a fade, and displacement animation.In addition to using attributes in an XML layout file animateLayoutChanges . You can also create LayoutTransition objects with the Setlayouttransition () method set in. The source code is as follows:private ViewGroup mContainerView; @Overrideprotected
Alps/packages/apps/camera/src/com/android/camera/filesaver.java1:import Java.util.Locale;2:modify the function:public void Refactoertitle () {......if (mtag! = intermedia_image) {If the data is Intermedia file,the file name notThe indexMtitle + = String.Format ("%02d", Mindex);}Setignorethumbnail (TRUE);}Changed to:public void Refactoertitle () {......if (mtag! = intermedia_image) {If the data is Intermedia file,the file name notThe indexMtitle + = St
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.