FindNetworkActivity.FindLocationFragment¶
-
public static class
FindLocationFragment
extends Fragment implements SearchView.OnQueryTextListener¶ The fragment for finding the from location.
Constructors¶
Methods¶
newInstance¶
-
public static FindLocationFragment
newInstance
(int sectionNumber)¶ Returns a new instance of this fragment for the given section number.
onCreateView¶
-
public View
onCreateView
(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)¶ Create the displayed fragment.
Parameters: - inflater – Creates the user interface from
R.layout.fragment_find_location
- container – Parent container to attach inflated
View
to - savedInstanceState – Previous state that is not used.
Returns: The inflated view to display.
- inflater – Creates the user interface from
onQueryTextChange¶
onQueryTextSubmit¶
-
public boolean
onQueryTextSubmit
(String query)¶ When the user submits a query, call
FindLocationFragment.search()
Parameters: - query – Query text that is discarded.
Returns: Always returns
true
search¶
-
public void
search
()¶ Use
API.Get.autocompletePlace(RequestQueue,String,Response.Listener)
to get autocomplete results for the user’s query. Pass those results toFindLocationFragment.adapter
, which will then populateFindLocationFragment.searchList