代号One-未在Samsung Tab中打开PDF(Samsung SM T377A)

时间:2018-06-20 07:34:08

标签: android codenameone

enter image description here

以下代码用于通过Mobile App打开PDF文档。该代码可在Apple和Android手机上使用。但是我仅在Android Samsung Tab E上遇到此问题。请告知是否有人遇到相同问题。这是否取决于我在平板电脑上下载的Adobe Acrobat软件?我尝试在设备上安装2个不同的应用程序,以确保应用程序与该软件具有足够的兼容性。

在打开的屏幕上,我提供了打开PDF文件的链接,当用户打开文件时,我将保存文件并在需要时将其打开。该功能适用​​于所有其他设备,但不适用于具有7.1.1版的特定平板电脑。请建议

放置文件的代码:

Button b = new Button("Terms of Service"); 
b.getAllStyles().setTextDecoration(Style.TEXT_DECORATION_UNDERLINE);                   
b.addActionListener(e3 -> {
try {
FileSystemStorage fs = FileSystemStorage.getInstance();
final String homePath = fs.getAppHomePath();
String fileName = homePath + "Terms of Service.pdf";                            
Util.copy(Display.getInstance().getResourceAsStream(getClass(), "/Terms of Service 
.pdf"), 
fs.openOutputStream(fileName)); 
Display.getInstance().execute(fileName);                            
} catch (IOException ex) {
}
}); 

检索文件的代码:

  Button devGuide = new Button("Terms");
  devGuide.setUIID("TextField");
  devGuide.addActionListener(e -> {
  FileSystemStorage fs = FileSystemStorage.getInstance();
  final String homePath = fs.getAppHomePath();
  String fileName = homePath + "Terms of Service.pdf";
  Display.getInstance().execute(fileName);
  });

enter image description here

enter image description here

0 个答案:

没有答案