yama
yama

Reputation: 41

android2.1 ListView reference

Hi i'm making a project and used a ListView in it. I've given it's code as

<ListView android:id="@android:id/android:list"
      android:layout_width="fill_parent" 
          android:layout_height="wrap_content"
</ListView>

I would need to work with the above list and i'm unable to refer it with

findViewById(@android:id/android/list);

even "R.id" isn't working.

I should use a OnClickListener().

Thank you in advance...

Upvotes: 1

Views: 118

Answers (2)

Sephy
Sephy

Reputation: 50392

the correct way is :

getViewById(android.R.id.list);

Upvotes: 4

NagarjunaReddy
NagarjunaReddy

Reputation: 8645

try this it is useful

<ListView 
  android:id="@+id/list"
  android:layout_width="fill_parent" 
  android:layout_height="wrap_content" >
</ListView>

and

findViewById(R.id.list);

Upvotes: 1

Related Questions