java - getView from overloaded ArrayAdapter is not beeing called from AsyncTask / onPostExecute -
Hi My first post here is a little more advanced app for my Android phone a little earlier ... I know That this topic was mentioned here, Google knows many examples, although they are not fine, which are the visible formats; (
I agree that in the case of Android coding ... a few days ago, please forgive me :)
The problem is that my list view is not populated The app compiles and runs without errors, but this lunch does not see get the food. What I have read on the web ... I need to display my sweet list view with my content ...
Please help :)
Package Com.test .stackParser; Public class StackParser extends activity activity {/ ** is called when activity first created * / personal progress DIOL PD; Crate on Public Zero (Bundle Saved Instantstate) {Super. Secret (Saved Instantstate); SetContentView (R.layout.main); // Last TextView TV = (TextView) Find VVBID (RIDTEXView1); //tv.setMovementMethod (new scrollingmountment); Button Button = (Button) Find VVBIID (R.B. button 1); Button.setOnClickListener (myListener); } Private OnListListMy Listener = New Onclickest Lester () {Click on Public Zero (see V) {PD = Progress DLOgh. Show (StackPerser activity., "Working ...", "request from server", right, wrong); New parsight () Execute ("http://multikino.pl/pl/repertuar/warszawa-ursynow/2011-09-02/"); }}; Private class parasite antic Tasks and Lit; String, void, list & lt; String & gt; & Gt; {Secure list & lt; String & gt; DoInBackground (string ... arg) {List & lt; String & gt; Output = new arreelist & lt; String & gt; (); Try {HtmlHelper hh = New HtmlHelper (new URL (Arg [0])); & Lt; TagNode & gt; Link = hh.getLinksByClass ("title"); (Iterator & Lt; TagNode> Iterator = Links.Applications (); Iterator. Next ();) {tagnode divElement = (tagnode) iterator.next (); Output.add (divElement.getText () toString ().); } Log D. ("Dupa", "cypressed"); } Hold (exception e) {e.printStackTrace (); } Return output; } Secure Exclute at zero (list & lt; string & gt; output) {pd.dismiss (); Log D. ("Dupa", "PostExecute"); List View List View = (List View) ViewById (R.id.listViewData); //listview.setAdapter (new arrayAdapter (StackPerser activate.This, Android R.Layout, .system_list_item_1, output)); MyAdapter dupa = New MyAdapter (StackParserActivity.this, android.R.layout.simple_list_item_1, R.id.movieTitle, Output); Dupa.notifyDataSetChanged (); Listview.setAdapter (dupa); Dupa.notifyDataSetChanged (); }} Private class increases MyAdapter ArrayAdapter & lt; String & gt; {String [] tab obz; Public MyAdapter (context reference, int resource, int text viewersource id, list; lt; string & gt; output) {super (context, resource, text view resource ISD); TabObj = output.toArray (new string [] {}); Log D. ("Dupa", Tab Obze [2] .ststring ()); NotifyDataSetChanged (); // Tudo Auto-Generated Constructor Stub} @ Override Public View getView (see the status of int, seeview view, parent group guard) {// Tudo auto-generated method stub log. D. ("Duka", "Dots Mill"); Layout Inflight Inflator = (Layout Influenza) getSystemService (References LAOUT_INFLATER_SERVICE); See line = inflator.inflat (r.layout.ro_layout, guardian, wrong); TextView TV = (TextView) row.findvibid (rid.movie title); Tv.setText (tabObj [status]); // button buton1 = (button) row.findViewById (R.id.buttonInfo); // button button2 = (button) row.findViewById (R.id.buttonReserve); Return super.getView (Status, Convertview, Parents); }}; }
return line Remove notifyDatasetChanged () from getView method to myadapter constructor. @Override Public View getView (int position, seeviewview, ViewGroup parent) {// TODO auto-generated method stub log D. ("Dupa", "!!!! GetView"); Layout Inflight Inflator = (Layout Influenza) getSystemService (References LAOUT_INFLATER_SERVICE); See line = inflator.inflat (r.layout.ro_layout, guardian, wrong); TextView TV = (TextView) row.findvibid (rid.movie title); Tv.setText (tabObj [status]); // button buton1 = (button) row.findViewById (R.id.buttonInfo); // button button2 = (button) row.findViewById (R.id.buttonReserve); Return line; } Edit : Try to override the getCount in the adapter, where you size () Tab Obze
Comments
Post a Comment