ChooseNearLocationActivity¶
-
public class
ChooseNearLocationActivity
extends AppCompatActivity implements SearchView.OnQueryTextListener¶ This screen let’s the user choose where they live now. This is used by
FindNetworkActivity
to restrict displayed networks to those with anear
that matches where the user lives.
Methods¶
onCreate¶
-
protected void
onCreate
(Bundle savedInstanceState)¶ Setup the activity. Also initializes the
com.android.volley.RequestQueue
, the adapter that populates the list of results, and the listener that handles clicks on items in the results listParameters: - savedInstanceState – Previous state that is passed through to superclass
onQueryTextChange¶
onQueryTextSubmit¶
-
public boolean
onQueryTextSubmit
(String query)¶ When the user submits their query,
ChooseNearLocationActivity.search()
is run to populated the results with matchingLocation
sParameters: - query – User’s query. Not used.
Returns: Always returns
true
search¶
-
public void
search
()¶ Get the query present in the
ChooseNearLocationActivity.searchView
and pass it to the server viaAPI.Get.autocompletePlace(RequestQueue,String,Response.Listener)
to get a list of matchingLocation
s. These are used to populate theChooseNearLocationActivity.adapter
.