Code example for AbsListView

Methods: getLastVisiblePosition

0
				Log.i("lasPosition", String.valueOf(listView.getLastVisiblePosition()));
				/**计算屏幕显示最后一项的下标(部分显示也算),下标从0开始**/ 
				lastItem = firstVisibleItem + visibleItemCount - 1 ;
				Log.i("lastItem:", String.valueOf(lastItem));
				//test和lastItem数值一样,跳入源码看getLastVisiblePosition()方法就知道了 
			    int test = view.getLastVisiblePosition();
			    Log.i("test:", String.valueOf(test));
			     
 
			} 
		}); 
		addBtn.setOnClickListener(new OnClickListener() {
			 
			@Override 
			public void onClick(View v) {
				// TODO Auto-generated method stub 
				String phoneNumber = edit.getText().toString();
				final Button button = new Button(MainActivity.this);
				button.setText(phoneNumber);
				addLinearLayout.addView(button);
				button.setOnClickListener(new OnClickListener() {