µ±Ç°Î»Ö㺠´úÂëÃÔ >> Android >> androidѧϰ֮ʵʱÎļþ¼ÐµÄ´´Éè
  Ïêϸ½â¾ö·½°¸

androidѧϰ֮ʵʱÎļþ¼ÐµÄ´´Éè

Èȶȣº74   ·¢²¼Ê±¼ä£º2016-05-01 14:23:36.0
androidѧϰ֮ʵʱÎļþ¼ÐµÄ´´½¨
?public class Activity01 extends Activity{	public void onCreate(Bundle savedInstanceState)	{		super.onCreate(savedInstanceState);		// setContentView(R.layout.main);		// ÅжÏÊÇ·ñ´´½¨ÊµÊ±Îļþ¼Ð		if (getIntent().getAction().equals(LiveFolders.ACTION_CREATE_LIVE_FOLDER))		{			Intent intent = new Intent();			// ÉèÖÃÊý¾ÝµØÖ·			intent.setData(Uri.parse("content://contacts/live_folders/people"));			// ÉèÖõ±ÎÒÃǵ¥»÷Ö®ºóµÄʼþ£¬ÕâÀïµ¥»÷Ò»¸öÁªÏµÈ˺󣬺ô½Ð			intent.putExtra(LiveFolders.EXTRA_LIVE_FOLDER_BASE_INTENT, new Intent(Intent.ACTION_CALL, ContactsContract.Contacts.CONTENT_URI));			// ÉèÖÃʵʱÎļþ¼ÐµÄÃû×Ö			intent.putExtra(LiveFolders.EXTRA_LIVE_FOLDER_NAME, "µç»°±¾");			// ÉèÖÃʵʩÎļþ¼ÐµÄͼ±ê			intent.putExtra(LiveFolders.EXTRA_LIVE_FOLDER_ICON, Intent.ShortcutIconResource.fromContext(this, R.drawable.contacts));			// ÉèÖÃÏÔʾģʽΪÁбí			intent.putExtra(LiveFolders.EXTRA_LIVE_FOLDER_DISPLAY_MODE, LiveFolders.DISPLAY_MODE_LIST);			// Íê³É			setResult(RESULT_OK, intent);		}		else		{			setResult(RESULT_CANCELED);		}		finish();	}}

?ÔÚmainfest.xmlÖеÄÅäÖãº

?

?

?<activity android:name=".Activity01"
????????????????? android:label="@string/app_name">
??????????? <intent-filter>
???? ?<action android:name= "android.intent.action.CREATE_LIVE_FOLDER" />
????<category android:name= "android.intent.category.DEFAULT" />
??????????? </intent-filter>
??????? </activity>

?

ÐèÒªÔÚÖ÷Ò³ÃæÖа´menu¼ü£¬È»ºóµã»÷Ìí¼ÓÎļþ¼ÐµÄ·½Ê½Ìí¼ÓʵʱÎļþ¼Ð

  Ïà¹Ø½â¾ö·½°¸