java - 如何存储通话记录

标签 java android

我正在使用接收调用日志的 Sip 帐户开发一个 Voip 应用程序,但我想存储调用日志,当我关闭应用程序并再次重新加载从 recyclerview 单元中删除的调用日志时。我正在使用 Linphone 库来获取通话日志。 我如何存储通话记录。

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;

最佳答案

使用 sqlite 或替代方案来保存通话记录。 Tutorial to save data

关于java - 如何存储通话记录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50318105/

相关文章:

java - 如何将复杂的YAML解析为Java对象层次结构(Spring Boot配置)

java - Spring Scope代理模式AspectJ?

java - 当 concurrencyLevel 大于 ConcurrentHashMap 的容量时会发生什么?

java - 如何在包上使用 NonNullByDefault

java - Google App Engine - 如何让演示发挥作用?

java - SimpleDateFormat 中的日期字符串解析不正确

android - 从 Assets 中的子文件夹中获取文件

android - 2014 年最佳移动检测(Rails 和 JS)

android - 如何检测 livecard 中的手势

android - 解析数据时出错 org.json.JSONException : Value ���� of type java. lang.String 无法转换为 JSONObject