我正在获取我的 gmail 帐户的收件箱文件夹,可以列出传入的电子邮件,但该列表是从旧邮件到新邮件列出的。我怎样才能恢复呢?
public class readInbox extends ListActivity{
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
//setContentView(R.layout.readmail);
Message[] messages = new Message[] { };
try {
messages = inboxReader.getMail();
}
catch (MessagingException e) {
Log.e("mailReader getMail error. in readmail.java", e.getMessage(), e);
}
ArrayAdapter<Message> adapter = new ArrayAdapter<Message>(this,
R.layout.simple_list_item_1 ,messages){
@Override
public View getView(int position, View convertView, ViewGroup parent) {
Message message = getItem(position);
TextView resultView = new TextView(super.getContext());
try {
resultView.setText(message.getSubject());
}
catch (MessagingException e) {
Log.e("resultView.setText in readmail", e.getMessage(), e);
}
return resultView;
}
};
setListAdapter(adapter);
}
}