Hello, this is my code
import android.app.ListActivity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.ListView;
public class AnimalsActivity extends ListActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
String[] Animals = {"Cat","Dog","Horse","Pig"};
ListView lv = (ListView)findViewById(R.id.listv11);
ArrayAdapter<String> _adap;
_adap = new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1, Animals);
lv.setAdapter(_adap);
}
}
The problem is with
ListView lv = (ListView)findViewById(R.id.listv11);
When i give LV ID
android:id="@+id/listView1"
IT DONT WORK
BUT - When i give
android:id="@+android:id/list"
It work, but the problem is, it take only an id
id:/list
So, i cant have 2 same ListView's :/ thats fail way...
Any suggestion?