use of com.here.android.mpa.search.DiscoveryResult in project here-android-sdk-examples by heremaps.
the class ResultListAdapter method getView.
@Override
public View getView(int position, View convertView, ViewGroup parent) {
DiscoveryResult discoveryResult = m_discoveryResultList.get(position);
if (convertView == null) {
convertView = LayoutInflater.from(getContext()).inflate(R.layout.result_list_item, parent, false);
}
/*
* Display title and vicinity information of each result. Please refer to HERE Android SDK
* API doc for all supported APIs.
*/
TextView tv = (TextView) convertView.findViewById(R.id.name);
tv.setText(discoveryResult.getTitle());
tv = (TextView) convertView.findViewById(R.id.vicinity);
tv.setText(String.format("Vicinity: %s", discoveryResult.getVicinity()));
return convertView;
}
use of com.here.android.mpa.search.DiscoveryResult in project here-android-sdk-examples by heremaps.
the class ResultListActivity method onListItemClick.
/* Retrieve details of the place selected */
@Override
public void onListItemClick(ListView l, View v, int position, long id) {
DiscoveryResult result = MapFragmentView.s_ResultList.get(position);
if (result.getResultType() == DiscoveryResult.ResultType.PLACE) {
/* Fire the PlaceRequest */
PlaceLink placeLink = (PlaceLink) result;
PlaceRequest placeRequest = placeLink.getDetailsRequest();
placeRequest.execute(m_placeResultListener);
} else if (result.getResultType() == DiscoveryResult.ResultType.DISCOVERY) {
/*
* Another DiscoveryRequest object can be obtained by calling DiscoveryLink.getRequest()
*/
Toast.makeText(this, "This is a DiscoveryLink result", Toast.LENGTH_SHORT).show();
}
}
use of com.here.android.mpa.search.DiscoveryResult in project here-android-sdk-examples by heremaps.
the class ResultListActivity method onListItemClick.
/* Retrieve details of the place selected */
@Override
public void onListItemClick(ListView l, View v, int position, long id) {
DiscoveryResult result = MapFragmentView.s_discoverResultList.get(position);
if (result.getResultType() == DiscoveryResult.ResultType.PLACE) {
/* Fire the PlaceRequest */
PlaceLink placeLink = (PlaceLink) result;
PlaceRequest placeRequest = placeLink.getDetailsRequest();
placeRequest.execute(m_placeResultListener);
} else if (result.getResultType() == DiscoveryResult.ResultType.DISCOVERY) {
/*
* Another DiscoveryRequest object can be obtained by calling DiscoveryLink.getRequest()
*/
Toast.makeText(this, "This is a DiscoveryLink result", Toast.LENGTH_SHORT).show();
}
}
use of com.here.android.mpa.search.DiscoveryResult in project here-android-sdk-examples by heremaps.
the class ResultListAdapter method getView.
@Override
public View getView(int position, View convertView, ViewGroup parent) {
DiscoveryResult discoveryResult = m_discoveryResultList.get(position);
if (convertView == null) {
convertView = LayoutInflater.from(getContext()).inflate(R.layout.result_list_item, parent, false);
}
/*
* Display title and vicinity information of each result.Please refer to HERE Android SDK
* API doc for all supported APIs.
*/
TextView tv = (TextView) convertView.findViewById(R.id.name);
tv.setText(discoveryResult.getTitle());
tv = (TextView) convertView.findViewById(R.id.vicinity);
tv.setText(String.format("Vicinity: %s", discoveryResult.getVicinity()));
return convertView;
}
Aggregations