关于Android Force Close 出现的缘由 以及解决方法 致使出现Force Close的缘由有不少,常见的有好比空指针啦,类没有找到啦,资源没找到,就连Android API使用的顺序错误也可能致使(好比setContentView()以前进行了findViewById()操做) Force Close有的人说能够用来让应用彻底退出 而故意致使这个问题,让程序强制关闭,这种作法我仍是不经常使用。 如何避免弹出Force Close窗口 能够实现Thread.UncaughtExceptionHandler接口的uncaughtException方法 代码以下: import java.lang.Thread.UncaughtExceptionHandler; import android.app.Application; public class MyApplication extends Application implements UncaughtExceptionHandler { @Override public void onCreate() { // TODO Auto-generated method stub super.onCreate(); } @Override public void uncaughtException(Thread thread, Throwable ex) { thread.setDefaultUncaughtExceptionHandler( this); } } 再补充一句,想要哪一个线程能够处理未捕获异常,thread.setDefaultUncaughtExceptionHandler( this); 这句代码都要在那个线程中执行一次