私はlistViewを作成したいと思いますが、私はすべてのlistitemに2つの異なるtextViewとボタンを持たせたいと考えていますか?listViewアイテムに2つのTextViewを含めることは可能ですか?
私は
public class main extends Activity {
private ListView lv1;
private String lv_arr[]={"a","b","c","d"};
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.main);
lv1=(ListView)findViewById(R.id.list);
lv1.setAdapter(new ArrayAdapter<String>(this,R.layout.row , lv_arr));
lv1.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
switch(position)
{
case 0: Intent newActivity = new Intent(chania.this, cafe.class);
break;
//...........
}
}
});
}
}
他にもありますか? – kostas