* 修正金沙中文網搜尋後資料無法開啟的問題
> 如果已經加入書籤者, 請移除後再加入.
Google Play: 小說閱讀器 v1.3.5
java.lang.IllegalStateException: The content of the adapter has changed but ListView did not receive a notification.
Make sure the content of your adapter is not modified from a background thread,
but only from the UI thread. [in ListView(16908298, class android.widget.ListView)
with Adapter(class android.widget.HeaderViewListAdapter)]
} else if (mItemCount != mAdapter.getCount()) {
throw new IllegalStateException("The content of the adapter has changed but "
+ "ListView did not receive a notification. Make sure the content of "
+ "your adapter is not modified from a background thread, but only "
+ "from the UI thread. [in ListView(" + getId() + ", " + getClass()
+ ") with Adapter(" + mAdapter.getClass() + ")]");
}
public void add(T object) {
synchronized (mLock) {
if (mOriginalValues != null) {
mOriginalValues.add(object);
} else {
mObjects.add(object);
}
}
if (mNotifyOnChange) notifyDataSetChanged();
}
import android.content.Context; import android.widget.ArrayAdapter; import java.util.List; public class MyArrayAdapterextends ArrayAdapter { private List mObjects; private int count = 0; private boolean mNotifyOnChange = true; public MyArrayAdapter(Context context, int textViewResourceId, List objects) { super(context, textViewResourceId, objects); mObjects = objects; count = objects.size(); } final public void beginTrans() { setNotifyOnChange(false); mNotifyOnChange = false; } final public void endTrans() { setNotifyOnChange(true); notifyDataSetChanged(); } @Override final public int getCount() { return count; } @Override final public void notifyDataSetChanged() { count = mObjects.size(); mNotifyOnChange = true; super.notifyDataSetChanged(); } @Override final public T getItem(int position) { if (position >= getCount()) { return null; } if (position >= mObjects.size()) { return null; } return super.getItem(position); } }
git tag -d v1.1.1 git push origin :refs/tags/v1.1.1