Re: [android-developers] Re: onItemClick(AdapterView? parent, View view,

2010-12-03 Thread Tapomay Dey
Mark has been repeatedly saying don't call getview Adding to it, your call to adapt.notifyDataSetChanged(); is what's going to trigger a getView() call for each of the items visible in your list. So some internal code in listview widget is what's going to call getview, not the user(you). However

[android-developers] Re: onItemClick(AdapterView? parent, View view,

2010-12-02 Thread kiros88
Okay like where do u gets getView I dont see that function in the Listview class or the adapterView class so im not really sure where im suppose to be able to call getView. On Dec 1, 7:54 pm, Prakash Iyer thei...@gmail.com wrote: My 2c - you are over-complicating this.The getView is ONLY to

Re: [android-developers] Re: onItemClick(AdapterView? parent, View view,

2010-12-02 Thread Mark Murphy
On Thu, Dec 2, 2010 at 2:06 PM, kiros88 ghui...@gmail.com wrote: Okay like where do u gets getView I dont see that function in the Listview class or the adapterView class so im not really sure where im suppose to be able to call getView. Generally, you do not call getView(). You implement

[android-developers] Re: onItemClick(AdapterView? parent, View view,

2010-12-02 Thread kiros88
Okay wait so i get the concept tthat u do a getView from an ArrayAdapter but what i tried this before during the i called the adapter i used ArrayAdapter adapt = new ArrayAdapterString(this,android.R.layout.simple_list_item_1 , songs); then after its already created i do public void

Re: [android-developers] Re: onItemClick(AdapterView? parent, View view,

2010-12-02 Thread Mark Murphy
Of course. Again, ordinarily, you do not call getView(). You are going about your problem in the wrong way. You are attempting to change your UI directly by grabbing some row out of a ListView and changing it. That's not going to be reliable at all, since that row might not exist. Rather, you

Re: [android-developers] Re: onItemClick(AdapterView? parent, View view,

2010-12-02 Thread Frank Weiss
Admittedly, I haven't read this thread in detail. It seems to me, that using an MVC approach is called for. The controller (the click handler) shouldn't be calling the view directly. The controller should call the model. The model will update the view accordingly. -- You received this message

Re: [android-developers] Re: onItemClick(AdapterView? parent, View view,

2010-12-02 Thread Prakash Iyer
You need to do setText in your implementation of getView. In the item clicked, store your state and call notifyDatasetChanged (check the exact name). Do not call getView... On Dec 2, 2010 2:18 PM, kiros88 ghui...@gmail.com wrote: Okay wait so i get the concept tthat u do a getView from an

[android-developers] Re: onItemClick(AdapterView? parent, View view,

2010-12-02 Thread kiros88
Okay so i guess this kinda makes sense I'm not really sure how am i suppose to change my data model. I did ((TextView)adapt.getView(0, null, parent)).setText(hello); adapt.notifyDataSetChanged(); but nothing changed ? On Dec 2, 11:28 am, Mark Murphy mmur...@commonsware.com wrote: Of course.

Re: [android-developers] Re: onItemClick(AdapterView? parent, View view,

2010-12-02 Thread Mark Murphy
On Thu, Dec 2, 2010 at 3:05 PM, kiros88 ghui...@gmail.com wrote: Okay so i guess this kinda makes sense I'm not really sure how am i suppose to change my data model. I did ((TextView)adapt.getView(0, null, parent)).setText(hello); adapt.notifyDataSetChanged(); but nothing changed ? You did

[android-developers] Re: onItemClick(AdapterView? parent, View view,

2010-12-01 Thread jotobjects
Its probably a bad idea to play with any View managed by the Adapter other than the one that is passed to onItemClick() or to getView(). So the idea that you find view + 1 is not going to work. There is lots of tricky View pool activity behind the scenes so you can't make any assumptions about