FindNetworkActivity.FindLocationFragment

public static class FindLocationFragment extends Fragment implements SearchView.OnQueryTextListener

The fragment for finding the from location.

Constructors

FindLocationFragment

public FindLocationFragment()

Empty constructor that does nothing.

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.

onQueryTextChange

public boolean onQueryTextChange(String newText)

When the query text changes, do nothing to avoid expensive API calls.

Parameters:
  • newText – The updated query text.
Returns:

Always returns true.

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