The Android system is very convenient. You can use intent URI to call system contacts. The common methods are as follows:
Intent intent =NewIntent (intent. action_pick, contactscontract. Contacts. content_uri );
Startactivityforresult (intent, pick_contact );
HoweverMultiple contacts are obtained in onactivityresult. What should I do if I only want to select one contact?
IntentInt
When an android text message is selected as a recipient, the number search contact is changed to any location to start matching.The queryLocal function in ContactsProvider2.java is modified as follows:Case CALLABLES_FILTER:......If (searchPhoneNumber ){......Sb. append (Data. _ ID +"IN (select distinct" + PhoneLookupColumns. DATA_ID+ "FROM" + Tables. PHONE_LOOKUP+ "WHERE" + PhoneLookupColumns. NORMALIZED_NU
= new SimpleCursorAdapter(this, R.layout.listitemlayout, c, from, to, 0); ListView lv = (ListView)findViewById(R.id.contactListView); lv.setAdapter(adapter); lv.setOnItemClickListener(new ListView.OnItemClickListener(){ public void onItemClick(AdapterView
parent, View view, int pos, long id) { c.moveToPosition(pos); int rowId = c.getInt(c.getColumnIndexOrThrow(_id)); Uri outURI = ContentUris.withAppendedId(ContactsCo
The ListView of Android contacts is unique, but the source code is written to compare copy, when we want to use his time to extract from the source, it is not easy ah, and error prone, these days, I took him out, write a simple example, one is to their own memo, But to share with you, okay, let's take a look at the effect chart:
First of all, the Pinnedheaderlistview of the packaged lead department:
Copy Code code as follows:
public cla
1.2.3.4.6.7.enable ADB integration, Tools-adnroid8. The official simulator is too slow, or your next third-party simulator. HTTP://WWW.GENYMOTION.NET/9. Downloading a virtual device it's always going to work. Open C:\Users\ user name \appdata\local\genymobile\genymotion.log from the inside can be found related: September 12:56:27 [genymotion] [Debug] Downloading file "Http://dl.genymotion.com/dists/4.3/ova/genymotion_vbox86p_4.3_160825_131154.ova" Download to C:\Users\ user name \appdata\Local\g
[Java]View Plaincopyprint?
Get the intent in the middle of the image
Ivshowimage = (ImageView) Findviewbyid (r.id.call_log_detail_contact_img);
//Call phone number get avatar URI
Uri urinumber2contacts = URI
. Parse ("content://com.android.contacts/"
+ "data/phones/filter/" + strphonenumber);
Cursor cursorcantacts = sapplication.nowsapplication
. Getcontentresolver (). Query (urinumber2contacts, null, null,
null, null );
if (Cursorcantacts.getcount () > 0) { //If the cur
to introduce theAndroidapi.jnibridge,//need to introduce *Androidapi.JNI.Provider,//need to introduce $Androidapi.helpers;//need to introducePanax Notoginseng - {$R *.FMX} the {$R *. NMXHDPIPH.FMX ANDROID} + //define a Query method A procedureQuerycontact (AName:string; alist:tstrings); the var + Cursorcontactsphone:jcursor; -Selectionstring; $Oprojection:tjavaobjectarray; $Oselectionargs:tjavaobjectarray; - Fieldindex:integer; - begin the ifAlist
. Permission. FlashlightWhen you access the flashlight, the android Development Network prompts that HTC Dream does not contain the flashlight (allows access to the flashlight)
Android. Permission. force_backAllow the program to forcibly perform a back operation on activities (allows an application to force a back operation on whatever is the top activity .)
Android
Android components ------ list selection box, Android components ------ list
The list selection box provided by Android is equivalent to the selection drop-down box for web terminal user registration, such as the province and city
Recently began to learn the Android UI, a few related examples, the follow-up will be updated.
Copy Code code as follows:
Import android.app.ListActivity;
Import Android.os.Bundle;
Import Android.widget.ArrayAdapter;
/**
* A List View example where the
* Data for the "list comes from" an array of strings.
*/
public class List1 extends Lista
An Android application requires permissions to call functions of some android systems. An android application may be called by other applications. Therefore, you must declare the permissions required to call the Android Application. In addition to frequently-used permissions, remember to be familiar with them. There ar
information from the system service (allowsan application to retrieve state dump information from systemservices .)Android. Permission. expand_status_barAllows a program to expand and contract to the status bar. The Android Development Network prompts that the program is similar to the pallet Program (allows an application to expand or collapse the statusbar.) in Windows Mobile .)
I recently started to learn about the android ui. First, I will give several related examples, and there will be some updates later.
Copy codeThe Code is as follows: import android. app. ListActivity;
Import android. OS. Bundle;
Import android. widget. ArrayAdapter;
/*** A list
Today, the boss has a requirement to add our applications to the sharing list. I can't do it on Android. Well, let's not say anything. Find information.
First, the following steps should be taken based on multiple experiences.
1. Search for logs. logcat is a good thing that can help you quickly locateProgramNot only can we find bugs, but some prompts can help you find some entry points to solve the p
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.