我正在使用收到呼叫日志的Sip帐户开发一个Voip应用程序,但我想存储通话记录,当我关闭应用程序并再次重新加载从recyclerview单元中删除的通话记录。我使用Linphone库来获取CallLogs。 我如何存储通话记录。
class CallHistoryAdapter extends BaseAdapter {
@Override
public int getCount() {
mLogs = Arrays.asList(LinphoneManager.getLc().getCallLogs());
return mLogs.size();
}
@Override
public Object getItem(int position) {
return mLogs.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
View view = null;
ViewHolder holder = null;
if (convertView != null) {
view = convertView;
holder = (ViewHolder) view.getTag();
} else {
view = mInflater.inflate(R.layout.history_cell, parent, false);
holder = new ViewHolder(view);
view.setTag(holder);
}
if (mLogs == null || mLogs.size() < position)
return view;