How to get rid of this?.To get rid of pest problem under control, inspection is the first and foremost step.
The common name of small fruit fly comes from their small size and fondness for fruits as egg laying and developmental sites. The name of vinegar fly comes from the fact they develop in the briny or vinegarlike liquids at the top of imperfectly sealed canned fruits and vegetables. Note that only flies of the family Tephritidae can properly be called fruit flies. These are nuisance pests but may act as disease vectors. The best known of these flies is D. melanogaster Meigen which has been used extensively in the study of heredity. They are worldwide in distribution and are found throughout the United States.
(Drosophila spp.) Adults about 1/8″ (3-4 mm) long, including the wings. Color dull, tan to brownish yellow or brownish black; eyes usually bright red. Antenna with feathery bristle (arista). Wing with coastal vein (thickened front margin) broken twice, near end of humeral cross vein (short vein perpendicular to costa near wing base) and near end of vein R1 (1st vein behind costa). First hind tarsal segment long and slender, much longer than 2nd segment. Drosophila melanogaster adults about 1/8″ (3 mm) long, tan with abdomen blackish above and grayish below, and bright red eyes.
Mature D. melanogaster larvae are about 1/4-3/8″ (7-8 mm) long, eyeless, legless, and tapering towards head from large rounded rear segment, head represented by 2 dark hooks. Color near white except mouth hooks black and tips of posterior terminal abdominal spiracles (breathing pores) yellowish. Posterior spiracles at end of short stalks/fleshy tubes which are in contact or joined at their bases. Other species may have posterior spiracle stalks dark and/or have whorls of setae (hairs) at their ends, and/or have the bottom side of abdomen with darkened cross bands (setulae).
(1) Small dung flies (Sphaeroceridae) with 1st hind tarsal segment broad and shorter than 2nd segment, wing with costar vein (thickened front margin) broken 3 times (additionally before humeral cross vein). (2) Humpbacked flies (Phoridae) with humpback appearance, wing with strong/dark basal front veins (costar area) and 4-5 weaker (less distinct) unbranched oblique veins, hind femora flattened. (3) Moth/drain/sewage flies (Psychodidae) have body and wing veins densely covered with hairs. (4) Fungus gnats (Mycetophilidae) and darkwinged fungus gnats (Sciaridae) are slender, long-legged, mosquitolike, with elongated coxae, wing costa (front margin) unbroken, antenna lacks an arista/bristle. (5) Other small flies either lack antenna with a feathery bristle and/or wing with a twice broken costar vein.
Adult females lay their eggs (average about 500) near the surface of fermenting fruits and vegetables or near the cover crack of imperfectly sealed containers of such materials. The eggs hatch in about 30 hours. The larvae develop in the briny or vinegarlike liquids of the fermenting materials where they feed near the surface and primarily on the yeast, for about 5-6 days. Prior to pupation, the larvae crawl to drier areas of the food or elsewhere. The brown, seedlike sheath containing the pupa (the puparium) is formed from the last larval skin/exoskeleton. The newly emerged adults mate in about 2 days. The life cycle (adult to adult) may be completed in 8-10 days at 85 degrees F (29 degrees C). Their reproductive potential is enormous.
Small fruit flies are attracted primarily to fresh fruits and vegetables and those fermenting because of yeast. Materials lose their attractiveness when they begin to decay because of bacteria and fungi. Materials commonly infested include bananas, grapes, peaches, pineapples, tomatoes, mustard pickles, potatoes, etc. and fermenting liquids such as beer, cider, vinegar, and wine; some species are attracted to human and animal excrement. The larvae develop primarily in liquids and near the surface but seek drier areas for pupation. Newly emerged adults are attracted to lights. Because of their short life cycle of 8-10 days, they can exploit many temporarily available developmental sites such as sour mop and broom heads, fruit under a table or cabinet, fruit left out in a bowl, etc. Dishwater and mop water full of food particles can accumulate on surfaces and/or in crevices and ferment, providing ideal fly breeding conditions.
Adults tend to hover in small circles. Because of their small size, many species are able to penetrate ordinary screens.
The key to small fruit fly control is sanitation. Elimination of larval food and developmental sites is mandatory. The presence of adult flies usually means that larvae are developing in some nearby fermenting material. If the flies are coming from outdoors, reducing the screen mesh size can be helpful because most species can penetrate ordinary screens. The number of adults can be reduced through the use of insect electrocuters (light traps), and/or better, the use of baited jar traps with special tops which allow access but discourage escape. Adults can be easily killed with an appropriately labeled aerosol, or ULV application. However, such relief will only be temporary, lasting only until new adults emerge, unless proper sanitation has been practiced.