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
ArrayAdapter<String>(this,android.R.layout.simple_list_item_1 ,
songs);
then after its already created i do
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
((TextView)adapt.getView(position+1,null,parent)).setText("hello");
And this doesnt work it crashes the app
On Dec 2, 11:06 am, kiros88 <[email protected]> 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.
>
> On Dec 1, 7:54 pm, Prakash Iyer <[email protected]> wrote:
>
>
>
>
>
>
>
> > My 2c - you are over-complicating this.The getView is ONLY to give back the
> > view for the item that is requested. If you want this item to be colored X
> > then do it here. If you want another item to be colored Y then do it when
> > getView is called for that item. The state maintenance, i.e. what is X or Y
> > is done independent of the code within getView which needs to just return
> > the View...
>
> > As for the specific text, if you are returning a TextView t, then t.setText
> > would work.
>
> > On Wed, Dec 1, 2010 at 9:14 PM, kiros88 <[email protected]> wrote:
> > > Okay i dont want to get to many ppl confused so im going to try to ask
> > > this very simply. When android goes to this function when a user
> > > clicks on a item on your listview. basically u get a parent who im
> > > assuming is the array of textview that was set up during the
> > > setAdapter phase and view which the the corresponding View to which
> > > the user touched. My main and only questions is i know i can adjust
> > > the view of View by saying stuff like
>
> > > (TextView)view = setText("hello")
>
> > > during the same time i want to beable to change another TextView in
> > > the AdapterView like the View after the "View view" so i guess view
> > > +1 i want to also be able to change that view into another word.
>
> > > Please dont ask me y im doing this just that im doing it for a reason
> > > I just really need help and i hope this explains that During the
> > > onItemClick listener function basically I want to adjust 2 different
> > > Views in the arrays of Views but i have no idea how to access the any
> > > other view then the given "View view" thats the argument they give you
>
> > > --
> > > You received this message because you are subscribed to the Google
> > > Groups "Android Developers" group.
> > > To post to this group, send email to [email protected]
> > > To unsubscribe from this group, send email to
> > > [email protected]<android-developers%2Bunsubs
> > > [email protected]>
> > > For more options, visit this group at
> > >http://groups.google.com/group/android-developers?hl=en
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en