Maybe. Some tenants think that filing a bankruptcy petition will prevent them from being evicted. This is not always true. Filing bankruptcy is a serious decision with many long-term consequences beyond the eviction action. In addition, much of what the public knows about bankruptcy has been changed by the Bankruptcy Abuse Prevention and Consumer Protection Act of 2005.
A tenant who is thinking about filing bankruptcy because of the threat of eviction, or for any reason, should consult a bankruptcy expert and carefully weigh the expert's advice.
A tenant who files a bankruptcy petition after October 17, 2005 (the effective date of the 2005 Bankruptcy Act) normally is entitled to an immediate automatic stay (delay) of a pending unlawful detainer action. If the landlord hasn't already filed the unlawful detainer action, the automatic stay prevents the landlord from taking steps such as serving a three-day notice or filing the action.
However, the landlord may petition the bankruptcy court for permission to proceed with the unlawful detainer action (called "relief from the automatic stay"). The automatic stay may continue in effect until the bankruptcy case is closed, dismissed, or completed. On the other hand, the bankruptcy court may lift the stay if the landlord shows that he or she is entitled to relief. The automatic stay normally does not prevent the landlord from enforcing an unlawful detainer judgment that was obtained before the tenant's petition was filed. In some cases, however, the tenant may be able to keep the stay in effect for 30 days after the petition is filed.
The automatic stay does not apply if the landlord's eviction action is based on the tenant's endangering the rental property or using illegal controlled substances on the property, and if the landlord files a required certification with the bankruptcy court. The stay normally will remain in effect, however, for 15 days after the landlord files the certification with the court.
A bankruptcy case can be dismissed for "cause" - for example, if the tenant neglects to pay fees or file necessary schedules and financial information, causes unreasonable delay that harms the landlord, or files the case in bad faith.
In short, filing for bankruptcy is not a guarantee to stopping the unlawful detainer.
The general rule is if you file bankruptcy, all legal actions against you are automatically stayed. The landlord would have to go bankruptcy to get relief from stay before he can proceed with the UD trial. Just make sure you inform the judge as soon as possible. Enforcement of judgment may also be stayed even if you proceed to trial had lose. But landlord can always go the BK court to get relief from the automatic stay.