Intravesical instillation is the main therapy for bladder cancer and interstitial cystitis. However, most drug solutions are eliminated from bladder after the first voiding of urine. To solve this problem, we proposed a floating hydrogel with self-generating micro-bubbles as a new delivery system. It floated in urine, avoiding the urinary obstruction and bladder irritation that ordinary hydrogels caused. In this study, we abandoned traditional gas-producing method like chemical decomposition of NaHCO3, and used the foamability of Poloxamer 407 (P407) instead. Through simple shaking (just like shaking SonoVue for contrast-enhanced ultrasound in clinical), the P407 solution will “lock” many micro-bubbles and float in urine as quickly and steadily as other gas producing materials. In vivo release experiments showed that drug was released continually from hydrogel for 10 h during the erosion process. Thus, the residence time of drug in bladder was prolonged and drug efficacy was improved. In vivo efficacy study using rabbit acute bladder injury model showed that prolonged drug residence time in bladder increased the efficiency of heparin in the protection of bladder mucosal permeability. Therefore, our floating hydrogel system with self-generating micro-bubbles was single-component, simply prepared and efficacy enhancing, successfully exempting users from worries on safety and clinical efficiency from bench to bedside.