ListView添加到LinearLayout流程
刚刚在学习如何将联系人信息显示到ListView中,并且将ListView显示到LinearLayout中时,对其中的一些流程有了初步的一些了解:
首先需要初始化要显示到屏幕上的LinearLayout对象和显示联系人信息的ListView对象,ListView显示在LinearLayout中。
其次将ListAdapter和ListView连接起来,并将ListAdapter添加到ListVew中。
再将ListView对象添加到LinearLayout对象中。
再将LinearLayout对象显示到屏幕上。
然后可以操作ListView的项选择onItemSelectedListener事件和项选择onItemClickListener事件。
流程:
实例化LinearLayout、ListVew-->ListAdapter连接ListView、ListAdapter add ListView-->ListView add LinearLayout-->LinearLay显示到屏幕-->处理ListView的onItemSelectedListner和onItemClickListener事件