@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Bundle args = getArguments(); if (args != null) { mType = args.getInt(Const.Bundle.TYPE); mAddress = args.getParcelable(Const.Bundle.LOCATION); } else { throw new IllegalArgumentException("Arguments not passed"); } // Check to see if a voice recognition activity is present on device PackageManager pm = mContext.getPackageManager(); List<ResolveInfo> activities = pm.queryIntentActivities(new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0); mVoiceSearchAvailable = (activities.size() != 0); }
@Override public void onAttach(Activity activity) { super.onAttach(activity); mHostActivity = (AddressSearchHostInterface) activity; }