My style, no more nonsense to say, directly to everyone paste code.
The specific code looks like this:
Package Com.org.demo.demo;
Import COM.ORG.WANGFENG.R;
Import android.app.Activity;
Import android.content.Intent;
Import Android.os.Bundle;
Import Android.util.Log;
Import Android.view.View;
Import Android.widget.Button;
Import Android.widget.EditText;
public class Getphoneactivity extends activity {private EditText edittext;
Private button button; @Override protected void OnCreate (Bundle savedinstancestate) {//TODO auto-generated Method stub super.oncreate (save
Dinstancestate);
Setcontentview (r.layout.getphoneactivity);
EditText = (edittext) Findviewbyid (R.id.et_getphone);
Button = (button) Findviewbyid (R.id.bb_getphone); Button.setonclicklistener (New View.onclicklistener () {@Override public void OnClick (View arg0) {//TODO auto-g
enerated method Stub Intent Intent = new Intent (getphoneactivity.this, Contactactivity.class);
Startactivityforresult (Intent, 1);
}
}); @Override protected void Onactivityresult (int requestcode, int resulTcode, Intent data) {//System.out.println ("ResultCode:" + ResultCode);
System.out.println ("Requestcode:" + requestcode);
LOG.D ("Jiejie", "called");
if (ResultCode = = ACTIVITY.RESULT_OK) {String phone = Data.getstringextra ("Phone");
LOG.D ("Jiejie", "_______________" +phone); Phone = Phone.replaceall ("-", ""). ReplaceAll ("", "");//replace-and space edittext.settext (phone);//Set phone number to input box} Super.ona
Ctivityresult (Requestcode, ResultCode, data);
}} package Com.org.demo.demo;
Import java.util.ArrayList;
Import Java.util.HashMap;
Import COM.ORG.WANGFENG.R;
Import android.app.Activity;
Import android.content.Intent;
Import Android.database.Cursor;
Import Android.net.Uri;
Import Android.os.Bundle;
Import Android.view.View;
Import Android.widget.AdapterView;
Import Android.widget.ListView;
Import Android.widget.SimpleAdapter;
Import Android.widget.AdapterView.OnItemClickListener;
Import Android.widget.TextView; public class Contactactivity extends activity {private ListView Lvlist;
Private arraylist
This is the end of this code, the code is relatively simple, and with comments, I hope to learn about Android to obtain mobile phone contact information to help.