Look Inside Yourself
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:paddingLeft="2px"
android:paddingTop="2px"
android:paddingBottom="2px"
android:paddingRight="5px"
/>
android:id="@+id/label"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/icon"
android:textSize="11pt"
android:paddingTop="2px"
android:paddingBottom="2px"
/>
Then, let's implement onActivityResult() on Contacter to get the selected
contact, get access to the PackageManager, craft an empty Intent on the
selected contact, and query the PackageManager for available activities that
work with that Intent. Finally, we sort the resulting list of ResolveInfo
objects and pour them into an ActionAdapter:
@Override
protected void onActivityResult(int requestCode, int resultCode,
Intent data) {
if (requestCode==PICK_REQUEST) {
if (resultCode==RESULT_OK) {
Uri contact=data.getData();
Intent stub=new Intent();
stub.setData(contact);
PackageManager pm=getPackageManager();
List actions=pm.queryIntentActivities(stub, 0);
Collections.sort(actions,
new ResolveInfo.DisplayNameComparator(pm));
setListAdapter(new ActionAdapter(pm, actions));
}
}
}
309
Subscribe to updates at http://commonsware.com
Special Creative Commons BY-NC-SA 3.0 License Edition
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:paddingLeft="2px"
android:paddingTop="2px"
android:paddingBottom="2px"
android:paddingRight="5px"
/>
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/icon"
android:textSize="11pt"
android:paddingTop="2px"
android:paddingBottom="2px"
/>
Then, let's implement onActivityResult() on Contacter to get the selected
contact, get access to the PackageManager, craft an empty Intent on the
selected contact, and query the PackageManager for available activities that
work with that Intent. Finally, we sort the resulting list of ResolveInfo
objects and pour them into an ActionAdapter:
@Override
protected void onActivityResult(int requestCode, int resultCode,
Intent data) {
if (requestCode==PICK_REQUEST) {
if (resultCode==RESULT_OK) {
Uri contact=data.getData();
Intent stub=new Intent();
stub.setData(contact);
PackageManager pm=getPackageManager();
List
Collections.sort(actions,
new ResolveInfo.DisplayNameComparator(pm));
setListAdapter(new ActionAdapter(pm, actions));
}
}
}
309
Subscribe to updates at http://commonsware.com
Special Creative Commons BY-NC-SA 3.0 License Edition
