Search in sources :

Example 1 with PlaceLink

use of com.here.android.mpa.search.PlaceLink 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();
    }
}
Also used : PlaceLink(com.here.android.mpa.search.PlaceLink) PlaceRequest(com.here.android.mpa.search.PlaceRequest) DiscoveryResult(com.here.android.mpa.search.DiscoveryResult)

Example 2 with PlaceLink

use of com.here.android.mpa.search.PlaceLink 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();
    }
}
Also used : PlaceLink(com.here.android.mpa.search.PlaceLink) PlaceRequest(com.here.android.mpa.search.PlaceRequest) DiscoveryResult(com.here.android.mpa.search.DiscoveryResult)

Aggregations

DiscoveryResult (com.here.android.mpa.search.DiscoveryResult)2 PlaceLink (com.here.android.mpa.search.PlaceLink)2 PlaceRequest (com.here.android.mpa.search.PlaceRequest)2