我想绕过文本视图的唯一一侧,如左上角的圆形和右上角的一轮,我使用此代码.但它不起作用.
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<solid android:color="@color/login_layout" />
<stroke
android:width="1dp"
android:color="@color/login_layout" />
<padding
android:bottom="1dp"
android:left="1dp"
android:right="1dp"
android:top="1dp" />
<corners
android:bottomLeftRadius="0dip"
android:bottomRightRadius="0dip"
android:topLeftRadius="10dip"
android:topRightRadius="10dip" />
</shape>
Run Code Online (Sandbox Code Playgroud) 我想从本地打开 PDF 文件,然后显示 PDF 内容,然后如果用户复制任何文本,那么我想获取复制的文本。因此,请向我建议与此问题相关的任何 API 或解决方案,并且具有挑战性的任务是复制文本并获取我想要的文本。我也使用了这段代码,但它是通过使用内部应用程序(如 adobe reader)打开的 PDF,所以我不知道 adobe reader 允许我访问复制文本。
File file = new File(Environment.getExternalStorageDirectory() + "/test.pdf");
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(file),"application/pdf");
intent.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
startActivity(intent);
Run Code Online (Sandbox Code Playgroud)