Fly biting
Fly biting (also called fly catching or fly snapping) refers to episodes of intentional focused biting at the air, as if the dog is biting at imaginary flies. Cavalier King Charles Spaniels appear to be predisposed to fly catching syndrome, though it has been documented in many different breeds and mixes. Age of onset is varied. Fly biting is an uncommon idiopathic syndrome which is poorly understood. Theories on the cause include seizures, compulsive disorder, gastrointestinal conditions, and visual abnormalities. It appears that fly catching syndrome may be caused by more than one condition, and as a result, treatment is varied and unique to each situation. Episode characteristics 
Before an episode begins, dogs raise their heads and extend their necks and appear to focus on something in the air. Episodes may occur sporadically or at regular intervals, and consist of a varying number of snaps. These episodes may be accompanied by behavioral changes such as agitation or increased owner attachment, or other behaviors, such as jumping, pica, and licking. Licking is the most common cooccurrence in literature on the syndrome and includes licking of the front limbs, hips, air, and floor. Speculated causes

Epilepsy 
Seizure activity is considered one of the more likely causes of fly biting episodes. Epileptic discharge in the visual cortex have been connected to subsequent fly catching syndrome. Veterinary neurologists believe fly biting episodes to be a type of complex partial seizure, which can cause abnormal movements while the dog remains conscious. In some cases, antiepileptic drugs successfully reduce or eliminate fly catching, which suggests epilepsy to be the source of the behavior. Compulsive disorder 
Compulsive disorder (CD) is a canine disorder similar to obsessive-compulsive disorder in humans. It is characterized by abnormal repetitive behavior that is not caused by any underlying conditions. Fly biting is one of these abnormal repetitive behaviors. In dogs where antiepileptic drugs do not have a noticeable effect on fly biting episodes, epilepsy may be considered to be ruled out as an underlying condition, allowing for a CD diagnosis. Fly biting is sometimes accompanied by other CD behaviors, including licking

of the front limbs, licking the air, and pica. Dogs with CD can sometimes be distracted from compulsive behaviors like fly biting by external stimuli. Gastrointestinal conditions 

Case studies of dogs with gastrointestinal symptoms who also fly bite have found that upon treating the gastrointestinal symptoms, the fly biting behavior decreased, and in some cases went into remission. One study found an increase in fly biting in some dogs following meals. The same study theorizes that pain or discomfort may be the cause of other behaviors, specifically head raising and neck extension, and behavioral changes that occur alongside fly biting. Eye disease 
The first published mention of fly biting associated the behavior with eye disease, specifically synchysis scintillans, a condition resulting in eye floaters. It was suggested that dogs who fly bite were biting at floaters in their vision. No research exists to substantiate this association. Later publications suggest eye disease is unlikely to be the cause of fly biting. The Canine Epilepsy Project has looked for floaters in the eyes of many fly biting dogs without finding any. Treatments 
There are many treatments used for fly biting due to its multitude of possible causes. Dogs may undergo multiple different treatments before finding a successful treatment. If a dog who fly bites has indications of gastrointestinal upset, it is suggested they undergo a complete medical work-up. If there is a gastrointestinal condition present, it will be treated based on diagnosis. Treatments for gastrointestinal conditions may include things like dietary changes, hypoallergenic foods, antacids or antibiotics. For dogs without gastrointestinal conditions, phenobarbital or fluoxetine may be used. Phenobarbital and other antiepileptics have been found to be less effective in treating fly biting than fluoxetine. As a result, one study has suggested an initial 4-6 week trial of fluoxetine for dogs who fly bite with no known seizure history. References 

Wikipedia Student Program
Dog training and behavior