Tabnine Logo
ArrayAdapter.notifyDataSetChanged
Code IndexAdd Tabnine to your IDE (free)

How to use
notifyDataSetChanged
method
in
android.widget.ArrayAdapter

Best Java code snippets using android.widget.ArrayAdapter.notifyDataSetChanged (Showing top 20 results out of 1,017)

origin: daimajia/AndroidSwipeLayout

@Override
public void notifyDatasetChanged() {
  super.notifyDataSetChanged();
}
origin: cSploit/android

 @Override
 public void run() {
  mPortList.add(entry);
  mListAdapter.notifyDataSetChanged();
 }
});
origin: square/otto

 @Subscribe public void onLocationCleared(LocationClearEvent event) {
  locationEvents.clear();
  if (adapter != null) {
   adapter.notifyDataSetChanged();
  }
 }
}
origin: termux/termux-app

@SuppressLint("InflateParams")
void renameSession(final TerminalSession sessionToRename) {
  DialogUtils.textInput(this, R.string.session_rename_title, sessionToRename.mSessionName, R.string.session_rename_positive_button, text -> {
    sessionToRename.mSessionName = text;
    mListViewAdapter.notifyDataSetChanged();
  }, -1, null, -1, null, null);
}
origin: stackoverflow.com

 final ArrayAdapter adapter = ((ArrayAdapter)getListAdapter());
runOnUiThread(new Runnable() {
  public void run() {
    adapter.notifyDataSetChanged();
  }
});
origin: square/otto

@Subscribe public void onLocationChanged(LocationChangedEvent event) {
 locationEvents.add(0, event.toString());
 if (adapter != null) {
  adapter.notifyDataSetChanged();
 }
}
origin: kaushikgopal/RxJava-Android-Samples

 @Override
 public void onNext(Pair<User, Contributor> pair) {
  User user = pair.first;
  Contributor contributor = pair.second;
  _adapter.add(
    format(
      "%s(%s) has made %d contributions to %s",
      user.name,
      user.email,
      contributor.contributions,
      _repo.getText().toString()));
  _adapter.notifyDataSetChanged();
  Timber.d(
    "%s(%s) has made %d contributions to %s",
    user.name,
    user.email,
    contributor.contributions,
    _repo.getText().toString());
 }
}));
origin: cSploit/android

   @Override
   public void run() {
String addr;
if (name != null && !name.isEmpty()) {
 addr = name + " [" + address + "]";
} else {
 addr = address;
}
     if (usec > 0)
       mListAdapter.add(addr + " ( " + formatTime(usec) + " )");
     else
       mListAdapter.add(addr + getString(R.string.untraced_hops));
     mListAdapter.notifyDataSetChanged();
   }
 });
origin: termux/termux-app

@Override
public void onStart() {
  super.onStart();
  mIsVisible = true;
  if (mTermService != null) {
    // The service has connected, but data may have changed since we were last in the foreground.
    switchToSession(getStoredCurrentSessionOrLast());
    mListViewAdapter.notifyDataSetChanged();
  }
  registerReceiver(mBroadcastReceiever, new IntentFilter(RELOAD_STYLE_ACTION));
  // The current terminal session may have changed while being away, force
  // a refresh of the displayed terminal:
  mTerminalView.onScreenUpdated();
}
origin: guolindev/booksource

/**
 * 查询全国所有的省,优先从数据库查询,如果没有查询到再去服务器上查询。
 */
private void queryProvinces() {
  titleText.setText("中国");
  backButton.setVisibility(View.GONE);
  provinceList = DataSupport.findAll(Province.class);
  if (provinceList.size() > 0) {
    dataList.clear();
    for (Province province : provinceList) {
      dataList.add(province.getProvinceName());
    }
    adapter.notifyDataSetChanged();
    listView.setSelection(0);
    currentLevel = LEVEL_PROVINCE;
  } else {
    String address = "http://guolin.tech/api/china";
    queryFromServer(address, "province");
  }
}
origin: termux/termux-app

@Override
public void onTitleChanged(TerminalSession updatedSession) {
  if (!mIsVisible) return;
  if (updatedSession != getCurrentTermSession()) {
    // Only show toast for other sessions than the current one, since the user
    // probably consciously caused the title change to change in the current session
    // and don't want an annoying toast for that.
    showToast(toToastTitle(updatedSession), false);
  }
  mListViewAdapter.notifyDataSetChanged();
}
origin: termux/termux-app

public void removeFinishedSession(TerminalSession finishedSession) {
  // Return pressed with finished session - remove it.
  TermuxService service = mTermService;
  int index = service.removeTermSession(finishedSession);
  mListViewAdapter.notifyDataSetChanged();
  if (mTermService.getSessions().isEmpty()) {
    // There are no sessions to show, so finish the activity.
    finish();
  } else {
    if (index >= service.getSessions().size()) {
      index = service.getSessions().size() - 1;
    }
    switchToSession(service.getSessions().get(index));
  }
}
origin: guolindev/booksource

/**
 * 查询选中省内所有的市,优先从数据库查询,如果没有查询到再去服务器上查询。
 */
private void queryCities() {
  titleText.setText(selectedProvince.getProvinceName());
  backButton.setVisibility(View.VISIBLE);
  cityList = DataSupport.where("provinceid = ?", String.valueOf(selectedProvince.getId())).find(City.class);
  if (cityList.size() > 0) {
    dataList.clear();
    for (City city : cityList) {
      dataList.add(city.getCityName());
    }
    adapter.notifyDataSetChanged();
    listView.setSelection(0);
    currentLevel = LEVEL_CITY;
  } else {
    int provinceCode = selectedProvince.getProvinceCode();
    String address = "http://guolin.tech/api/china/" + provinceCode;
    queryFromServer(address, "city");
  }
}
origin: k9mail/k-9

protected void refreshView() {
  adapter.setNotifyOnChange(false);
  adapter.clear();
  identities = mAccount.getIdentities();
  for (Identity identity : identities) {
    String description = identity.getDescription();
    if (description == null || description.trim().isEmpty()) {
      description = getString(R.string.message_view_from_format, identity.getName(), identity.getEmail());
    }
    adapter.add(description);
  }
  adapter.notifyDataSetChanged();
}
origin: guolindev/booksource

/**
 * 查询选中市内所有的县,优先从数据库查询,如果没有查询到再去服务器上查询。
 */
private void queryCounties() {
  titleText.setText(selectedCity.getCityName());
  backButton.setVisibility(View.VISIBLE);
  countyList = DataSupport.where("cityid = ?", String.valueOf(selectedCity.getId())).find(County.class);
  if (countyList.size() > 0) {
    dataList.clear();
    for (County county : countyList) {
      dataList.add(county.getCountyName());
    }
    adapter.notifyDataSetChanged();
    listView.setSelection(0);
    currentLevel = LEVEL_COUNTY;
  } else {
    int provinceCode = selectedProvince.getProvinceCode();
    int cityCode = selectedCity.getCityCode();
    String address = "http://guolin.tech/api/china/" + provinceCode + "/" + cityCode;
    queryFromServer(address, "county");
  }
}
origin: termux/termux-app

void noteSessionInfo() {
  if (!mIsVisible) return;
  TerminalSession session = getCurrentTermSession();
  final int indexOfSession = mTermService.getSessions().indexOf(session);
  showToast(toToastTitle(session), false);
  mListViewAdapter.notifyDataSetChanged();
  final ListView lv = findViewById(R.id.left_drawer_list);
  lv.setItemChecked(indexOfSession, true);
  lv.smoothScrollToPosition(indexOfSession);
}
origin: termux/termux-app

@Override
public void onSessionFinished(final TerminalSession finishedSession) {
  if (mTermService.mWantsToStop) {
    // The service wants to stop as soon as possible.
    finish();
    return;
  }
  if (mIsVisible && finishedSession != getCurrentTermSession()) {
    // Show toast for non-current sessions that exit.
    int indexOfSession = mTermService.getSessions().indexOf(finishedSession);
    // Verify that session was not removed before we got told about it finishing:
    if (indexOfSession >= 0)
      showToast(toToastTitle(finishedSession) + " - exited", true);
  }
  if (mTermService.getSessions().size() > 1) {
    removeFinishedSession(finishedSession);
  }
  mListViewAdapter.notifyDataSetChanged();
}
origin: seven332/EhViewer

EhDB.insertQuickSearch(quickSearch);
list.add(quickSearch);
adapter.notifyDataSetChanged();
origin: stackoverflow.com

listViewDetected.setAdapter(detectedAdapter);
listItemClicked = new ListItemClicked();
detectedAdapter.notifyDataSetChanged();
listViewPaired.setAdapter(adapter);
      detectedAdapter.notifyDataSetChanged();
        detectedAdapter.notifyDataSetChanged();
origin: k9mail/k-9

/**
 * Publish the results to the user-interface.
 * {@inheritDoc}
 */
@SuppressWarnings("unchecked")
@Override
protected void publishResults(CharSequence constraint, FilterResults results) {
  // Don't notify for every change
  mFolders.setNotifyOnChange(false);
  try {
    //noinspection unchecked
    final List<T> folders = (List<T>) results.values;
    mFolders.clear();
    if (folders != null) {
      for (T folder : folders) {
        if (folder != null) {
          mFolders.add(folder);
        }
      }
    } else {
      Timber.w("FolderListFilter.publishResults - null search-result ");
    }
    // Send notification that the data set changed now
    mFolders.notifyDataSetChanged();
  } finally {
    // restore notification status
    mFolders.setNotifyOnChange(true);
  }
}
android.widgetArrayAdapternotifyDataSetChanged

Popular methods of ArrayAdapter

  • <init>
  • setDropDownViewResource
  • add
  • getView
  • getItem
  • createFromResource
  • getCount
  • clear
  • addAll
  • getPosition
  • remove
  • getDropDownView
  • remove,
  • getDropDownView,
  • insert,
  • getFilter,
  • setNotifyOnChange,
  • isEmpty,
  • getContext,
  • registerDataSetObserver,
  • unregisterDataSetObserver

Popular in Java

  • Reactive rest calls using spring rest template
  • setScale (BigDecimal)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • scheduleAtFixedRate (Timer)
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • JList (javax.swing)
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now