Checking for responding activities
Listing 15.15 Adding dummy code to verify filter (CrimeFragment.java)
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
...
final Intent pickContact = new Intent(Intent.ACTION_PICK,
ContactsContract.Contacts.CONTENT_URI);
pickContact.addCategory(Intent.CATEGORY_HOME);
mSuspectButton = (Button) v.findViewById(R.id.crime_suspect);
mSuspectButton.setOnClickListener(new View.OnClickListener() {
...
});
Run CriminalIntent again, and you should see the suspect button disabled (Figure 15.6).
Figure 15.6 Disabled suspect button
Delete the dummy code once you are done verifying this behavior.
Listing 15.16 Deleting dummy code (CrimeFragment.java)
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
...
final Intent pickContact = new Intent(Intent.ACTION_PICK,
ContactsContract.Contacts.CONTENT_URI);
pickContact.addCategory(Intent.CATEGORY_HOME);
mSuspectButton = (Button) v.findViewById(R.id.crime_suspect);
mSuspectButton.setOnClickListener(new View.OnClickListener() {
...
});