Skip to content

Instantly share code, notes, and snippets.

@nalitzis
Created May 12, 2012 15:54
Show Gist options
  • Save nalitzis/2667280 to your computer and use it in GitHub Desktop.
Save nalitzis/2667280 to your computer and use it in GitHub Desktop.
private abstract class CallbackListener implements INetworkTasksListener{
private CountDownLatch signal;
CallbackListener(CountDownLatch signal){
this.signal = signal;
}
public void onSuccess(Media... medias) {
signal.countDown();
}
public void onFail(Throwable t) {
signal.countDown();
}
}
private class GetMediaListener extends CallbackListener{
GetMediaListener(CountDownLatch signal){
super(signal);
}
public void onSuccess(Media... medias) {
Media m = medias[0];
Log.d(TAG, "media uri path is "+m.getMediaUrl());
Assert.assertTrue(true);
super.onSuccess(medias);
}
public void onFail(Throwable t) {
Assert.assertTrue(false);
super.onFail(t);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment