嗨我继续得到这个错误它在第9行xml的android.view.InflateException
继承人我的xml:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<com.SpaceShot.single android:id="@+id/single1"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</com.SpaceShot.single>
<ListView android:id="@+id/highScores"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</ListView>
</FrameLayout>
Run Code Online (Sandbox Code Playgroud) 嗨所以我的应用程序中存在相当大的内存泄漏,我认为这是由我的Runnables造成的.这是我使用的Runnables骨架的一个例子:
private Runnable randomAlienFire = new Runnable() {
public void run() {
/*A Bunch
of computations
*/
mainHandler.removeCallbacks(randomAlienFire);
mainHandler.postDelayed(randomAlienFire, number );
}
Run Code Online (Sandbox Code Playgroud)
当我切换活动时,我打电话mainHandler.removeCallbacksAndMessages(null);,thread.randomAlienFire = null;但我仍在泄漏整个活动.所以我的问题是,这个基本骨架中是否存在导致内存泄漏的问题?这可能是处理程序调用自身的事实吗?