Electronic device and method for controlling displays