Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

android - Strange ArrayAdapter behaviour -


i'm writing application android-based tablets. while have come far in development, there 1 bug don't understand , can't rid of. have gridview custom arrayadapter, contains downloadable items in it. each item in grid clickable relative layout, looks this:

<relativelayout>   <framelayout />   <textview />   <textview />   <progressbar />    </relativelayout> 

when item clicked, app try find on sd-card , show it. if fails, start downloading in it's own thread. file-downloading method standard, except 2 things things - has, said, it's own thread , updates progress-bar after downloading each data-chunk (which, @ moment, 2048 bytes):

while ((n = in.read(b,0,chunksize)) >= 0) {     out.write(b,0,n);      if (handler != null && progressbar != null) {         /* update progressbar:*/         currentbytes += n;         final int nbytes = currentbytes;         handler.post(new runnable() {             public void run() {                 progressbar.setprogress(nbytes);             }         });     } } 

this works well. here's how looks in real world (after clicking on 3rd icon; these items placeholders, downloaded files real):

[i couldn't post image (not enough rep), here's link]

http://i52.tinypic.com/20zb8jq.png

in same time can start second download , still work perfectly. can add elements @ end , work too. there slight problem, however. whenever use search button, starts new activity, , go activity, same gridview this:

[i couldn't post image , 1 hyperlink (not enough rep), here's link space]

http:// i54.tinypic.com/16kqgxg.png

it's still downloading right element, shows wrong progressbar. magazine still shown after downloading completes. unwanted effect items, downloading , progress bars, set clickable (i disable before starting downloading). here code (a bit shortened, doesn't matter) updating adapter:

list<magazine> newlist = cm.getmymags(); // returns list of current magazines list<magazine> oldlist = cachedadapter.mags; // use list.toarray() method in getview in adapter.  (magazine mag : newlist) {     if (!oldlist.contains(mag)) {         cachedadapter.add(mag);     } } 

i know it's not efficient way this, right care making work.
tried update list , call notifydatasetchanged(), gave same results. know might cause problem?

thank time.


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -