我需要实现具有自动滚动功能的列表视图,直到列表中最后看到的位置意味着当我第二次运行该活动时,它应该必须自动滚动到最后看到的位置。
在安卓中可以吗?我通过下面的数组适配器代码实现了我的列表:
setListAdapter(new QuestionsArrayAdapter(this, SUBJECT, AUTHOR, RESPONCES, DATETIME, NEWPOST, LOGOIMAGE));
QuestionArratAdapter 类是:
public class QuestionsArrayAdapter extends ArrayAdapter<String> {
public QuestionsArrayAdapter(Context context, String[] questions,
String[] author, String[] responces, String[] dateTime,
String[] newPost, String[] logoImage) {
super(context, R.layout.questionscreen, author);
this.context = context;
this.questions = questions;
this.author = author;
this.responces = responces;
this.dateTime = dateTime;
this.newPost = newPost;
this.logoImage = logoImage;
imageLoader=new ImageLoader(context.getApplicationContext());
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
//System.out.println(s);
//imageView.setImageResource(R.drawable.image_preview);
return rowView;
}