Wash the fruit as soon as you bring it in the house. Then you can store it in a bowl on the counter or in the fridge. Many times fruit fly eggs have already been laid on the skin of the fruit when you buy it - they are just waiting to hatch when you put them in your fruit bowl, so make sure to wash/rinse well upon bringing fruit home.
If I get some, I leave a glass of wine on the counter. The flies prefer a nice chardonnay (LOL) rather than the fruit, fall in, and that's the end of them.