Fruit flies lay their eggs close to the surfaces of the fruits that they are attracted to. Since fruit flies prefer warm, moist heat, the fruit that you leave on your counter rather than in the refrigerator, like unpeeled bananas and melons, is the most susceptible to fruit fly eggs. It's imperative that you wash the skins of the fruit you eat. Even though you don't actually ingest the skin, simply touching the fruit with your hands and then touching other items and your mouth can spread the eggs.
Pour 1 pint of water into a bowl large enough to house the unpeeled, uncut bananas or melon.
Add 2 tbsp. distilled white vinegar to the bowl
Place the fruit into the bowl and use your hands to gently scrub the mixture over the entire fruit. If necessary, add water and vinegar in the same ratio to cover larger fruit or to wash large amounts of fruit.
Rinse the bananas and melon thoroughly under running cool water, using your hands to spread the water over the fruits' surfaces to avoid a vinegar aftertaste.
Allow the fruit to dry on a towel before cutting and consuming it.
Store cut melons and bananas in an airtight container in the refrigerator for three to five days.