I have an activity which, essentially, starts multiple threads in order to get multiple resources from network. I update the UI after receiving the notifications from these threads using ResultReceiver mechanism. The code snippet looks like below,
public void onReceiveResult(int resultCode, Bundle resultData){
switch(resultCode){
case 1: updateData1();
break;
case 2: updateData2();
break;
case 3: updateData3();
break;
}
As, its the main thread which updates the UI elements on receiving the notifications from these threads, I was thinking it will be a good idea to make method onReceiveResult synchronized. Any comments? Is there is anything else that should be taken care of in order keep it efficient and safe?