Replacing old contacts API references with new ones.

This commit is contained in:
Dmitri Plotnikov 2009-09-08 14:34:07 -07:00
parent e8a37cf769
commit 4587efc1d3

View File

@ -42,8 +42,8 @@ import android.database.ContentObserver;
import android.database.Cursor; import android.database.Cursor;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.graphics.BitmapFactory; import android.graphics.BitmapFactory;
import android.graphics.drawable.Drawable;
import android.graphics.Rect; import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.media.MediaScannerConnection; import android.media.MediaScannerConnection;
import android.media.MediaScannerConnection.MediaScannerConnectionClient; import android.media.MediaScannerConnection.MediaScannerConnectionClient;
import android.net.Uri; import android.net.Uri;
@ -51,12 +51,9 @@ import android.os.AsyncTask;
import android.os.Bundle; import android.os.Bundle;
import android.os.Environment; import android.os.Environment;
import android.os.Handler; import android.os.Handler;
import android.provider.Contacts;
import android.provider.Contacts.Intents;
import android.provider.Contacts.People;
import android.provider.ContactsContract; import android.provider.ContactsContract;
import android.provider.ContactsContract.Presence;
import android.provider.ContactsContract.CommonDataKinds; import android.provider.ContactsContract.CommonDataKinds;
import android.provider.ContactsContract.Presence;
import android.text.util.Regex; import android.text.util.Regex;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.Menu; import android.view.Menu;
@ -462,20 +459,20 @@ public class MessageView extends Activity implements OnClickListener {
if (senderEmail != null) { if (senderEmail != null) {
Uri contactUri = Uri.fromParts("mailto", senderEmail.getAddress(), null); Uri contactUri = Uri.fromParts("mailto", senderEmail.getAddress(), null);
Intent contactIntent = new Intent(Contacts.Intents.SHOW_OR_CREATE_CONTACT); Intent contactIntent = new Intent(ContactsContract.Intents.SHOW_OR_CREATE_CONTACT);
contactIntent.setData(contactUri); contactIntent.setData(contactUri);
// Pass along full E-mail string for possible create dialog // Pass along full E-mail string for possible create dialog
contactIntent.putExtra(Contacts.Intents.EXTRA_CREATE_DESCRIPTION, contactIntent.putExtra(ContactsContract.Intents.EXTRA_CREATE_DESCRIPTION,
senderEmail.toString()); senderEmail.toString());
// Only provide personal name hint if we have one // Only provide personal name hint if we have one
String senderPersonal = senderEmail.getPersonal(); String senderPersonal = senderEmail.getPersonal();
if (senderPersonal != null) { if (senderPersonal != null) {
contactIntent.putExtra(Intents.Insert.NAME, senderPersonal); contactIntent.putExtra(ContactsContract.Intents.Insert.NAME, senderPersonal);
} }
contactIntent.putExtra(Intents.EXTRA_TARGET_RECT, contactIntent.putExtra(ContactsContract.Intents.EXTRA_TARGET_RECT,
getAbsoluteRect(mSenderPresenceView)); getAbsoluteRect(mSenderPresenceView));
startActivity(contactIntent); startActivity(contactIntent);
} }