예제 #1
0
  @Override
  protected void onDisplay(Bundle savedInstanceState, PluginController controller) {
    mController = (MapMainController) controller;
    mModel = (MapModel) controller.getModel();

    mLayout = new StandardLayout(this);
    mLayout.setText(getString(R.string.map_searching));

    setContentView(mLayout);

    LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    mLayout.addView(inflater.inflate(R.layout.map_search_result, null));

    setActionBarTitle(getString(R.string.map_plugin_title));
  }
예제 #2
0
  @Override
  public void searchResultsUpdated() {
    List<MapItem> results = mModel.getSearchResults();

    ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, R.layout.map_list);

    if (results.size() > 0) {
      for (MapItem meb : results) {
        adapter.add(meb.getTitle());
      }

      parseAndDisplayResult(adapter, results);

    } else {
      mLayout.setText(getString(R.string.map_search_no_results));
    }
  }