11-06 19:52:25.958: E/AndroidRuntime(29609): java.lang.IllegalStateException: アダプターの内容が変更されましたが、ListView は通知を受け取りませんでした。アダプターのコンテンツがバックグラウンド スレッドからではなく、UI スレッドからのみ変更されていることを確認してください。[ListView(-1、class android.widget.ListPopupWindow$DropDownListView) with Adapter(class com.example.parkfoxxlight_android.PlacesAutoCompleteAdapter)]
完全なログ: http://pastebin.com/Hx7k28Rm
アダプターの完全なコード: http://pastebin.com/TfH1bXE3 https://developers.google.com/places/training/autocomplete-androidの例を使用していますが、デフォルトのコードがかなりあるため、 Googleコードのバグ?
上記のエラー メッセージでアプリがクラッシュすることがあります。
protected void publishResults(CharSequence constraint,
FilterResults results) {
if (results != null && results.count > 0) {
notifyDataSetChanged();
} else {
notifyDataSetInvalidated();
}
}
活動http://pastebin.com/FYzYtvXY :
public class CityActivity extends Activity{
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.city);
AutoCompleteTextView autoCompView = (AutoCompleteTextView) findViewById(R.id.autocomplete_city);
PlacesAutoCompleteAdapter ad = new PlacesAutoCompleteAdapter(this);
ProgressBar b = (ProgressBar)findViewById(R.id.progressBar1);
ad.setLoadingIndicator(b);
autoCompView.setAdapter(ad);
}
}
これを修正する方法はありますか?私はアンドロイド4.3を使用しています。