Saturday, 15 February 2014

android - Error: Activity result fragment index out of range: 0x2fffe -



android - Error: Activity result fragment index out of range: 0x2fffe -

when im trying delete show asynctask. want phone call finish() after asynctask has been completed , homecoming intent result.

from activity:

new deleteshowtask().execute(); intent intent = new intent(seasonactivity.this, fragmentshows.class); // i'm not sure if works intent.putextra("tvdbid", tvdbid); setresult(deletecode, intent); finish();

then in fragment have this:

@override public void onactivityresult(int requestcode, int resultcode, intent data) { super.onactivityresult(requestcode, resultcode, data); log.d("resultcode", resultcode + ""); log.d("request code", requestcode +""); if (resultcode == seasonactivity.deletecode) { if (requestcode == seasonactivity.show) { string tvdbid = data.getstringextra("tvdbid"); (int = 0; < adapter.getcount(); i++) { sickbeardserie serie = adapter.getitem(i); if (serie.gettvdbid().equals(tvdbid)) { adapter.remove(serie); adapter.notifydatasetchanged(); } } } } }

but seems doenst run through onacitivityresult(). have logged onactivityresult() see dont logs. thing is: 10-19 16:21:44.631: w/fragmentactivity(27672): activity result fragment index out of range: 0x2fffe

i fixed using work around. reload asynctask in onresume() instead of removing item arraylist , calling adapter.notifydatasetchanged(). not best solution.

android android-fragments android-asynctask onactivityresult

No comments:

Post a Comment