@Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setTitle(R.string.uv_portal_title);
    getListView().setDivider(null);
    setListAdapter(new PortalAdapter(this));
    getListView().setOnItemClickListener(getModelAdapter());

    Babayaga.track(Babayaga.Event.VIEW_KB);
  }
  @Override
  protected void onPostExecute(final JSONObject result) {

    if (progressBar != null) {
      progressBar.setVisibility(4);
    }

    if (result == null && error.length() > 0) {
      // An error occurred.
      Toast.makeText(activity.getApplicationContext(), error, Toast.LENGTH_SHORT).show();
    } else {
      super.onPostExecute(result);
      if (activity instanceof ContactActivity) {
        ((ContactActivity) activity).setDataAndRestart(result);
      } else if (activity instanceof SearchActivity) {
        ((SearchActivity) activity).displayContactList(result);
      }
    }
  }
Ejemplo n.º 3
0
 @Override
 public void onActivityResult(final int requestCode, final int resultCode, final Intent intent) {
   final IntentResult scanResult =
       IntentIntegrator.parseActivityResult(requestCode, resultCode, intent);
   if (scanResult != null) {
     final String scan = scanResult.getContents();
     if (StringUtils.isBlank(scan)) {
       return;
     }
     SearchActivity.startActivityScan(scan, this);
   } else if (requestCode == SEARCH_REQUEST_CODE) {
     // SearchActivity activity returned without making a search
     if (resultCode == RESULT_CANCELED) {
       String query = intent.getStringExtra(SearchManager.QUERY);
       if (query == null) {
         query = "";
       }
       Dialogs.message(this, res.getString(R.string.unknown_scan) + "\n\n" + query);
     }
   }
 }
Ejemplo n.º 4
0
 @OnClick(R.id.bottom_bar_search_tv)
 void onSearchClick() {
   SearchActivity.navigateToSearch(ListActivity.this);
   overridePendingTransition(0, 0);
 }