2
我想將網格視圖的內容「重置」爲其初始值。 從我的活動在上創建我有Exchange服務已泄露ServiceConnection,GridView適配器
gridView = (GridView) findViewById(R.id.gridv);
gridView.setNumColumns(gridsize);
gridView.setAdapter(new Adapter(this, temp,gridsize));
然後當我嘗試將其復位,我做到了,像這樣
gridView.setAdapter(new Adapter(this, temp,gridsize));
gridView.invalidateViews();
它的工作原理,但我得到(從活動另一個函數調用)以下錯誤:(它不會崩潰)
10-22 18:12:39.719: E/ActivityThread(716): Service
com.android.exchange.ExchangeService has leaked ServiceConnection
[email protected]ee170 that was
originally bound here
10-22 18:12:39.719: E/ActivityThread(716): android.app.ServiceConnectionLeaked: Service
com.android.exchange.ExchangeService has leaked ServiceConnection
[email protected]ee170 that was originally bound here
它是在模擬器中,謝謝我以爲我做錯了什麼,可惜我沒有一個真正的設備來測試它。問候 – blended
任何機會,你知道一個「正式」的過程,實際上首先刪除網格視圖(的適配器)的內容,然後再次初始化,也許這將有助於 – blended
答案在於適配器,但你需要一個不同的職位它,因爲問題是完全不同的。 – wtsang02