| | |
| | | package com.hdl.photovoltaic.ui.test; |
| | | |
| | | |
| | | import android.content.Intent; |
| | | import android.net.Uri; |
| | | import android.os.Bundle; |
| | | import android.text.Spannable; |
| | | import android.text.SpannableStringBuilder; |
| | | import android.text.TextUtils; |
| | | import android.text.style.ForegroundColorSpan; |
| | | import android.view.View; |
| | | |
| | | import androidx.core.content.FileProvider; |
| | | |
| | | import com.hdl.photovoltaic.R; |
| | | import com.hdl.photovoltaic.base.CustomBaseActivity; |
| | |
| | | import com.hdl.photovoltaic.widget.ConfirmationCancelDialog; |
| | | import com.hdl.photovoltaic.widget.ListStaticDialog; |
| | | |
| | | import java.io.File; |
| | | import java.util.IdentityHashMap; |
| | | import java.util.Map; |
| | | |
| | |
| | | @Override |
| | | public void onClick(View v) { |
| | | //todo 需要调云端的接口 |
| | | HdlThreadLogic.toast(_mActivity, "还没有支持上传日志."); |
| | | // HdlThreadLogic.toast(_mActivity, "还没有支持上传日志."); |
| | | |
| | | // Intent sendIntent = new Intent(); |
| | | // sendIntent.setAction(Intent.ACTION_SEND); |
| | | // sendIntent.putExtra(Intent.EXTRA_TEXT, "This is my text to send."); |
| | | // sendIntent.setType("text/plain"); |
| | | // startActivity(Intent.createChooser(sendIntent, "Share via")); |
| | | try { |
| | | // 在Activity中创建分享Intent |
| | | Intent shareIntent = new Intent(Intent.ACTION_SEND); |
| | | shareIntent.setType("application/pdf"); // 根据要分享的文件类型设置MIME类型 |
| | | File file = new File(HdlFileLogic.getInstance().getLogFileNamePath()); // 指定文件路径 |
| | | Uri fileUri = FileProvider.getUriForFile(_mActivity, "com.hdl.photovoltaic.dc.fileprovider", file); |
| | | shareIntent.putExtra(Intent.EXTRA_STREAM, fileUri); |
| | | shareIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); |
| | | startActivity(Intent.createChooser(shareIntent, "Share file using")); |
| | | } catch (Exception ignored) { |
| | | HdlThreadLogic.toast(_mActivity, "分享失败"); |
| | | } |
| | | } |
| | | }); |
| | | |
| | |
| | | * 初始化界面 |
| | | */ |
| | | private void initView() { |
| | | String homeId = "测试住宅ID=" + UserConfigManage.getInstance().getHomeId(); |
| | | String homeName = "测试住宅名称=" + UserConfigManage.getInstance().getHomeName(); |
| | | String homeId = "日志住宅ID=" + UserConfigManage.getInstance().getHomeId(); |
| | | String homeName = "日志住宅名称=" + UserConfigManage.getInstance().getHomeName(); |
| | | viewBinding.homeIdTv.setText(homeId); |
| | | viewBinding.homeNameTv.setText(homeName); |
| | | showLoading(); |