I m implementing IPC via Handlers in an Android application. In the official documentation (here http://developer.android.com/reference/android/app/Service.html) there s an example:
class IncomingHandler extends Handler {
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case MSG_REGISTER_CLIENT:
mClients.add(msg.replyTo);
break;
case MSG_UNREGISTER_CLIENT:
mClients.remove(msg.replyTo);
break;
case MSG_SET_VALUE:
mValue = msg.arg1;
for (int i=mClients.size()-1; i>=0; i--) {
try {
mClients.get(i).send(Message.obtain(null,
MSG_SET_VALUE, mValue, 0));
} catch (RemoteException e) {
// The client is dead. Remove it from the list;
// we are going through the list from back to front
// so this is safe to do inside the loop.
mClients.remove(i);
}
}
break;
default:
super.handleMessage(msg);
}
}
}
我的问题是简单明了的:这一行文是什么?
super.handleMessage(msg);
我不得不说这种方法吗?
EDIT: I know that this will call the parent s implementation of that method. But what s in that method? Is there something special that have to be done prior the release of the message?
预 收