Reprint please indicate source: http://blog.csdn.net/android_ls/article/details/39928519 When you are working on a company project, you encounter the need to customize the grid view that displays your photos, showing the top 20 photos taken by the user recently with the camera. I looked at the system provides the API, did not find a direct point to take pictures after the camera to store the path constant, if you know, please tell me, thank you! Here is the stupid
When it comes to app automation, you're often asked how to know the app's package name and launch page name. The question is simple:1. The most direct way to ask development ah, they tell you the app's package name and start page.2. If you are shy and can see/understand the code, get the code and get it out.1) If it is an in-house app, download the latest code, t
Recently in the camera function, simple packaging system cameras, encountered a problem is that unable to get the current orientation of the screen caused the screen to rotate after the correct direction, so the picture is not in the right direction.Check it out on the Internet. The current screen orientation is obtained through the WindowManager display or the Getorientation method of the configuration. But the problem is that the two methods require
In a project, when you enter a page, EditText automatically gets the focus by default.So how do you cancel this default behavior?On the internet for a long time, a bit of listening to soft keyboard events, a little call Clearfouse () method, but the test is not! The corresponding attribute could not be found in XML to close this default behaviorSolution: Find one in EditText's parent control, set it toAndroid:focusable= "true"Android:focusableintouchmode= "true"In this
In a project, when you enter a page, EditText automatically gets the focus by default.So how do you cancel this default behavior?On the internet for a long time, a bit of listening to soft keyboard events, a little call Clearfouse () method, but the test is not! The corresponding attribute could not be found in XML to close this default behaviorSolution: Find one in EditText's parent control, set it toAndroid:focusable= "true"Android:focusableintouchmode= "true"In this
How to get android mobile phone contacts and display them in letters (2)
The following describes how to categorize and display contacts with the same initials:
In the adapter implement SectionIndexer
In this way, the adapter must implement the following three interfaces:
@ Overridepublic Object [] getSections () {// collection of sections} @ Overridepublic int g
First get the bitmap format screen by using the following function:
123456789101112131415161718192021222324252627
public Bitmap myShot(Activity activity) {// 获取windows中最顶层的viewView view = activity.getWindow().getDecorView();view.buildDrawingCache(); // 获取状态栏高度Rect rect = new Rect();view.getWindowVisibleDisplayFrame(rect);int statusBarHeights = rect.top;Display display = activity.getWindowManager().getDefaultDisplay();// 获取屏幕宽和高int wid
particularly handy, here are only a few ways to see the shell command:1. Dump Java Call stackThe Java call stack actually contains native stacks and kernel stacks, all of which are more visible. The way to use it is simple:[HTML]View PlainCopy
Kill-3 pid>
Because it is a virtual machine, it is currently available only for virtual machine processes (i.e. Java processes)2. Dump Native StackIt is easy to
If you want to get to the appropriate control by calling the Findviewbyid () method, you must require the layout of the current activity to pass through Setcontentview. If you add a layout in another way, to get the view object in this layout, you first need to inflate the layout and then raise the Findviewbyid () on that layout.1 View v = inflater.inflate (id_nu
/** * The way to use httpclientget request * * @param username * @param password * @return NULL indicates a problem with the path being evaluated, text returns the requested data */public Stati C string Httpclientget (string username, string password) {try {//1. Open a browser httpclient client = new Defaulthttpclient ();// 2. Enter the address string path = "Http://172.22.64.156:8080/0001AndroidWebService/LoginServlet?username=" + urlencoder.encode
In the Android development, we will inevitably do the registration function, and now most of the registration is registered with the mobile phone, then the registration will be required to obtain the verification code to verify the way, we next to combat the custom get the Verification code Countdown button:
1. See the effect chart first
2. The variables we i
thing. And this corresponds to the sentence
Copy Code code as follows:
Settestproviderenabled ("GPs", false);
Used to turn off the GPS.
Can the above method get the location after the GPS is opened? Or not! It is sometimes possible, because this function gets the location information that was obtained last time, assuming that if the program first ran, the location information was not previously acquired, and the return
Android: Three ways to get rid of title bar and three ways to fullscreenThe first type: A method commonly used when getting startedAdd the following code to the OnCreate function:Requestwindowfeature (window.feature_no_title);//Remove the title barNote This sentence must be written in front of the Setcontentview () method, or it will be an errorAnother type: defined in the Androidmanifest.xml fileCan be see
(mcursor.movetonext ()) {//print log to view the value of the photo id long id = mcursor.getlong (mcurso R.getcolumnindex (mediastore.images.media._id)); LOG.I ("mediastore.images.media_id=", ID + ""); Filter out unwanted images, just get pictures of photos stored in the photo album after the picture String path = mcursor.getstring (Mcursor.getcolumnindex (MEDIASTORE.IMAGES.MEDIA.D ATA)); if (Path.startswi
There are several options in the ListView, which can pop up a context menu and get detailed information about the options that you press by long pressing each option.Key steps:private static final int delete_id = Menu.first + 1;// uses Menu.first constants instead of other constants: program-encapsulated variables are not used to account for memory program read faster error- proneprivate static final int Edit_id=menu.first + 2;private static final in
Recently, when playing an app, found just entered his page, his page of the child controls are flying from the right side, feel good, the way to imitate a. It's much more comfortable to watch than to stay there!Still Feel good! Anyway, I think it's better than a stiff-looking! You guys think that!Looking at what we are imitating:Almost, just fine-tune it!The point code, in fact, is very simple:Create a new Anim folder to create a new two XMLJust put t
Need to list the picture file of the specified directory, draw on the method of the Internet, find out that the list is all the files, so it is inconvenient to use, here also did not find a solution, through their own further research finally fix, send up to useful classmates.In the following way can implement query implementation query SD card A subdirectory of the picture file details:
Selection: Specifying query criteria
String Selection = me
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.