logcat java.lang.IllegalStateException に表示されるエラー: アダプターの内容が変更されましたが、ListView は通知を受け取りませんでした。アダプターのコンテンツがバックグラウンド スレッドからではなく、UI スレッドからのみ変更されていることを確認してください。[ListView(2131165193、class android.widget.ListView) with Adapter(class com.example.recipestutors.ItemListBaseAdapter)] ItemListBaseAdapter.java
public class ItemListBaseAdapter extends BaseAdapter {
private static ArrayList<Recipedetails> itemDetailsrrayList;
private Integer[] imgid = {
R.drawable.vegeterian,
R.drawable.nonveg,
R.drawable.pickels,
R.drawable.soup,
R.drawable.sweets,
R.drawable.cakes,
R.drawable.icecreams,
R.drawable.chinesevegdishes,
R.drawable.chinesenonveg,
R.drawable.chinesenoodles,
R.drawable.chinesesoup,
R.drawable.godhumaivegadai,
R.drawable.soyamorekoozh,
R.drawable.tomatokulambu,
R.drawable.tomatoupma,
R.drawable.vadanavratrispecial,
R.drawable.eggkurma,
R.drawable.milagu,
R.drawable.rasam,
R.drawable.vegetablekootu,
R.drawable.avial,
R.drawable.kothavarangaicurry,
R.drawable.allepeyfishcurry,
R.drawable.spicymadraschicken,
R.drawable.prawns,
R.drawable.keralachickenstew,
R.drawable.nilgirichickenkorma,
R.drawable.pepperchickencurry,
R.drawable.chettiandchicken,
R.drawable.prawnmasala,
R.drawable.beeffry,
R.drawable.crispyfish,
R.drawable.amlapickle,
R.drawable.avakaipickle,
R.drawable.capsicumpickle,
R.drawable.lemonpickle,
R.drawable.onionpickle,
R.drawable.mangopickle,
R.drawable.tendermangopickle,
R.drawable.tomatopickle,
R.drawable.chillipickles,
R.drawable.gingerpickle,
R.drawable.garlicsoup,
R.drawable.mixedvegsoup,
R.drawable.chickenmanchowsoup,
R.drawable.cleartomatosoup,
R.drawable.sweetcornvegetablesoup,
R.drawable.prawnandnoodlesoup,
R.drawable.beetrootsoup,
R.drawable.capsicumsoup,
R.drawable.muttonsoup,
R.drawable.spinachsoup,
R.drawable.vegcurry,
R.drawable.mushroommutter,
R.drawable.alooparatha,
R.drawable.daltadka,
R.drawable.aloomethi,
R.drawable.rajma,
R.drawable.paneerbhujri,
R.drawable.alooghobi,
R.drawable.aloosabzi,
R.drawable.kadhaipaneer,
R.drawable.chickenwithbellpeppers,
R.drawable.butterchicken,
R.drawable.fishkorma,
R.drawable.prawnfry,
R.drawable.tandoorichicken,
R.drawable.maccherjholfish,
R.drawable.shamikabab,
R.drawable.saagmeat,
R.drawable.sindhichickenbiryani,
R.drawable.punjabichickencurry,
R.drawable.gulabjamun,
R.drawable.basundi,
R.drawable.peda,
R.drawable.badhamhalwa,
R.drawable.coconutburfi,
R.drawable.kulfi,
R.drawable.ladoo,
R.drawable.mysorepak,
R.drawable.ricekheer,
R.drawable.badam,
R.drawable.cauliflowersoup,
R.drawable.cucumbersoup,
R.drawable.tomatosoup,
R.drawable.mulligatawnysoup,
R.drawable.greenpeassoup,
R.drawable.northindianmuttonsoup,
R.drawable.chickennoodlesoup,
R.drawable.spicybeansoup,
R.drawable.eggdropsoup,
R.drawable.springvegsoup,
R.drawable.mushroomandseitan,
R.drawable.tofuwith3spices,
R.drawable.creamyvegpie,
R.drawable.grilledvegmedley,
R.drawable.bakedsquash,
R.drawable.africanchickenstew,
R.drawable.westafricanchicken,
R.drawable.africanyamsoup,
R.drawable.chickenchilliroast,
R.drawable.chilliblackbeans,
R.drawable.williecake,
R.drawable.pumpkingingercupcakes,
R.drawable.doublelayerpumpkincheesecake,
R.drawable.carrotcake,
R.drawable.sexcake,
R.drawable.chocolatechipicecream,
R.drawable.cookieicecream,
R.drawable.cinnamonicecream,
R.drawable.appleicecream,
R.drawable.walnut,
R.drawable.chineseaubergins,
R.drawable.spicycucumber,
R.drawable.chinesemushrooms,
R.drawable.chinesegobi,
R.drawable.spicytofu,
R.drawable.chinesetilchicken,
R.drawable.chickenmoongali,
R.drawable.sweetsourchicken,
R.drawable.cherrychicken,
R.drawable.mymasalachicken,
R.drawable.coldseasamenoodles,
R.drawable.sobanoodles,
R.drawable.noodleswithtofu,
R.drawable.chinesevegandbeef,
R.drawable.noodleswithpepper,
R.drawable.jhingasoup,
R.drawable.masalachickensoup,
R.drawable.cabbagesoup,
R.drawable.chinesepumpkinsoup,
R.drawable.baconsoup,
};
private LayoutInflater l_Inflater;
public ItemListBaseAdapter(Context context, ArrayList<Recipedetails> results) {
itemDetailsrrayList = results;
l_Inflater = LayoutInflater.from(context);
}
public int getCount() {
return itemDetailsrrayList.size();
}
public Object getItem(int position) {
return itemDetailsrrayList.get(position);
}
public long getItemId(int position) {
return position;
}
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder;
if (convertView == null) {
convertView = l_Inflater.inflate(R.layout.item_details_view, null);
holder = new ViewHolder();
holder.txt_itemName = (TextView) convertView.findViewById(R.id.name);
holder.txt_itemDescription = (TextView) convertView.findViewById(R.id.itemDescription);
//holder.recipeLinkWiki = (TextView) convertView.findViewById(R.id.recipeLinkWiki);
holder.itemImage = (ImageView) convertView.findViewById(R.id.photo);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
holder.txt_itemName.setText(itemDetailsrrayList.get(position).getName());
holder.txt_itemDescription.setText(itemDetailsrrayList.get(position).getItemDescription());
//holder.recipeLinkWiki.setText(itemDetailsrrayList.get(position).getUrlWiki());
holder.itemImage.setImageResource(imgid[itemDetailsrrayList.get(position).getImageNumber() - 1]);
return convertView;
}
static class ViewHolder {
//TextView recipeLinkWiki;
TextView txt_itemName;
TextView txt_itemDescription;
//TextView txt_recipeLinkWiki;
ImageView itemImage;
}
}
Logcat エラー:
03-18 12:59:18.592: E/AndroidRuntime(2010): FATAL EXCEPTION: main
03-18 12:59:18.592: E/AndroidRuntime(2010): 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(2131165193, class android.widget.ListView) with Adapter(class com.example.recipestutors.ItemListBaseAdapter)]
03-18 12:59:18.592: E/AndroidRuntime(2010): at android.widget.ListView.layoutChildren(ListView.java:1544)
03-18 12:59:18.592: E/AndroidRuntime(2010): at android.widget.AbsListView.onTouchEvent(AbsListView.java:3403)
03-18 12:59:18.592: E/AndroidRuntime(2010): at android.view.View.dispatchTouchEvent(View.java:7239)
03-18 12:59:18.592: E/AndroidRuntime(2010): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2168)
03-18 12:59:18.592: E/AndroidRuntime(2010): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1903)
03-18 12:59:18.592: E/AndroidRuntime(2010): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2174)
03-18 12:59:18.592: E/AndroidRuntime(2010): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1917)
03-18 12:59:18.592: E/AndroidRuntime(2010): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2174)
03-18 12:59:18.592: E/AndroidRuntime(2010): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1917)
03-18 12:59:18.592: E/AndroidRuntime(2010): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1953)
03-18 12:59:18.592: E/AndroidRuntime(2010): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1405)
03-18 12:59:18.592: E/AndroidRuntime(2010): at android.app.Activity.dispatchTouchEvent(Activity.java:2410)
03-18 12:59:18.592: E/AndroidRuntime(2010): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1901)
03-18 12:59:18.592: E/AndroidRuntime(2010): at android.view.View.dispatchPointerEvent(View.java:7419)
03-18 12:59:18.592: E/AndroidRuntime(2010): at android.view.ViewRootImpl.deliverPointerEvent(ViewRootImpl.java:3220)
03-18 12:59:18.592: E/AndroidRuntime(2010): at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:3165)
03-18 12:59:18.592: E/AndroidRuntime(2010): at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:4292)
03-18 12:59:18.592: E/AndroidRuntime(2010): at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:4271)
03-18 12:59:18.592: E/AndroidRuntime(2010): at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:4363)
03-18 12:59:18.592: E/AndroidRuntime(2010): at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:179)
03-18 12:59:18.592: E/AndroidRuntime(2010): at android.os.MessageQueue.nativePollOnce(Native Method)
03-18 12:59:18.592: E/AndroidRuntime(2010): at android.os.MessageQueue.next(MessageQueue.java:125)
03-18 12:59:18.592: E/AndroidRuntime(2010): at android.os.Looper.loop(Looper.java:124)
03-18 12:59:18.592: E/AndroidRuntime(2010): at android.app.ActivityThread.main(ActivityThread.java:5039)
03-18 12:59:18.592: E/AndroidRuntime(2010): at java.lang.reflect.Method.invokeNative(Native Method)
03-18 12:59:18.592: E/AndroidRuntime(2010): at java.lang.reflect.Method.invoke(Method.java:511)
03-18 12:59:18.592: E/AndroidRuntime(2010): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
03-18 12:59:18.592: E/AndroidRuntime(2010): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
03-18 12:59:18.592: E/AndroidRuntime(2010): at dalvik.system.NativeStart.main(Native Method)
03-18 12:59:21.032: I/Process(2010): Sending signal. PID: 2010 SIG: 9
03-18 12:59:21.672: E/Trace(2031): error opening trace file: No such file or directory (2)