Question: I want to change the background color for layouts dynamically for the first time only, using configuration file in android that file should be in assets folder,it can be xml file or anything.
please help me.

Answer: 
All answers are already there consider it just an addition-

->if both values goes for same memory address-result will be zero

->compilers can optimize away the temporary variable in the naive swap

->modern CPUs strive to execute instructions in parallel via instruction pipelines
but with XOR technique is considerably slower than using a temporary variable to do swapping because each operation depends on the result of previous

->x+Y may go for integer overflow
The performance gain is typically so small that the cost to "understandable code" is higher than the speed benefit obtained.