Improve type safety through the use of generics

This commit is contained in:
veyndan 2017-03-31 22:15:56 +01:00
parent 16553cc5e1
commit d8b7d5b438
6 changed files with 16 additions and 17 deletions

View file

@ -59,9 +59,9 @@ public abstract class HandlerService<T> extends Service {
threadHandler = new ServiceHandler(threadLooper);
}
private void postMessage(int type, Object obj) {
private void postMessage(int type, T t) {
Message msg = threadHandler.obtainMessage(type);
msg.obj = obj;
msg.obj = t;
threadHandler.sendMessage(msg);
}