简体   繁体   English

自动并以编程方式安装APK列表

[英]Installing a list of APK automatically and programmatically

I have a list of APK and it should be installed automatically. 我有APK清单,应该自动安装。

here's my current situation. 这是我目前的情况。

  • first APK appears, Install or Cancel 出现第一个APK,请安装或取消
  • user clicks install 用户点击安装
  • a windows appears and will ask the user to "open" or "done" 出现一个窗口,并要求用户“打开”或“完成”
  • but the problem is, after that window appears to choose "open" or "done", the next APK installation window appears and covering the "open" or "done" window of the first successful APK installed. 但是问题是,在该窗口显示为选择“打开”或“完成”之后,出现了下一个APK安装窗口,并覆盖了第一个成功安装的APK的“打开”或“完成”窗口。

How do you buffer that the next APK to install shall wait till the user chooses "open" or "done" after the first installation. 如何缓冲下一个要安装的APK将等待,直到用户在首次安装后选择“打开”或“完成”。

currently i'm trying out these methods but to no avail :( 目前,我正在尝试这些方法,但无济于事:(

 protected void onStart();

 protected void onRestart();

 protected void onResume();

 protected void onPause();

 protected void onStop();

 protected void onDestroy();

can anyone point out the right direction? 谁能指出正确的方向? i'm still new to this. 我还是这个新手。

thanks! 谢谢!

I think that it is not possible... You can only launch an Intent to install an apk but you can't be sure if the apk is installed (If he comes back as if he clicks on open after installation, he doesn't come back). 我认为这是不可能的...您只能启动一个Intent以安装apk,但不能确定apk是否已安装(如果他回来,好像他在安装后单击打开一样,则不会回来)。


But, in your Activity , the onResume method is called when the user comes back to your application. 但是,在Activity ,当用户回到您的应用程序时,将调用onResume方法。

You can at this moment check if the 1st apk is installed and launch the 2nd apk installation. 您现在可以检查是否已安装第一个apk并启动第二个apk安装。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM