如果未root设备,则以编程方式完成安装后,oreo中不会显示安装对话框

时间:2018-08-04 09:15:31

标签: android android-8.0-oreo android-update-app

在我的应用程序中显示警报对话框后,我试图更新应用程序。在Android Oreo下运行良好。这是我到目前为止尝试过的

//word app
Microsoft.Office.Interop.Word.Application winword = new Microsoft.Office.Interop.Word.Application();
winword.Visible = false;


//Temlate info
string templateName = "\\ATM_Template_V1.0.docx";
templatePath = templatePath + templateName;


//word file
Microsoft.Office.Interop.Word.Document document = winword.Documents.Add(templatePath);


//applying the radar chart 1
Microsoft.Office.Interop.Word.InlineShape chart1=document.InlineShapes[1];
if (document.InlineShapes[1].HasChart) ; //error


//closing word document
document.SaveAs(filePath);
document.Close();
document = null;



//finishing word application
winword = null;


//kill the process
Process[] procs = Process.GetProcessesByName("winword");
foreach (Process proc in procs)
proc.Kill();

如何在没有根目录的设备中显示此应用程序更新对话框。任何帮助,将不胜感激。提前感谢。

1 个答案:

答案 0 :(得分:0)

在manifest.xml文件中检查以下权限。

<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />

还要检查您的文件提供者是否有Intent.VIEW_ACTION。

更多参考,请查看此页面Android install apk with Intent.VIEW_ACTION not working with File provider

享受代码。

相关问题