It is definitely possible. An ideal way to do this might be to create a Handler
in your class. When the listener is called cancel a Runnable
that contains the submission code and post it to run in 1 second. If it is the first time you get the call back the cancel will have no effect but that is fine. Make sure your Runnable is not an anonymous one so that there is only one instance of it so it can be cancelled.
Your question is similar to this one:
How to remove a runnable from a handler object added by postDelayed?
Here is some code:
Handler mHandler = new Handler(Looper.getMainLooper());
Runnable mSubmit = new Runnable() {
public void run() {
// Submit to server ...
}
}
RatingBar.OnRatingBarChangeListener mListener =
new RatingBar.OnRatingBarChangeListener() {
void onRatingChanged(RatingBar ratingBar, float rating, boolean fromUser) {
mHandler.removeCallbacks(mSubmit);
mHandler.postDelayed(mSubmit, 1000);
}
}