简体   繁体   English

如何覆盖PackageInstaller对话框?

[英]How to Override PackageInstaller Dialogs?

I am trying to update my application from a URL because i am distributing my application through a server and not posting the application in the android market . 我试图通过URL更新我的应用程序,因为我正在通过服务器分发我的应用程序,而不是在android市场上发布该应用程序。 i am successful in updating the application. 我成功更新了应用程序。 But i do not want the dialog that appears after the update is complete. 但是我不希望更新完成后出现对话框。 the dialog that appears says "Application Installed" and it has two buttons 1) OPEN 2) DONE. 出现的对话框显示“已安装应用程序”,它具有两个按钮1)打开2)完成。 I do not want the second button "DONE". 我不希望第二个按钮“完成”。 i just want to display only one button ie "OPEN". 我只想显示一个按钮,即“ OPEN”。 How do i go about doing this ? 我该怎么做呢?

That is not possible. 这是不可能的。

This is the standard android procedure, you cannot change the way of installing an application and force the user to press Open. 这是标准的android过程,您无法更改安装应用程序的方式并强制用户按Open。 (The user can always press the Home or Back button) (用户始终可以按“主页”或“后退”按钮)

----- Edit -----编辑

You can start your application on the Package Installed Intent: 您可以在“软件包安装意图”上启动应用程序:

<receiver android:name=".IntentReceiver">
  <intent-filter>
    <action android:name="android.intent.action.PACKAGE_ADDED" />
    <action android:name="android.intent.action.PACKAGE_REPLACED"/>
    <action android:name="android.intent.action.PACKAGE_REMOVED" />
    <data android:scheme="package" />
  </intent-filter>
</receiver>

BroadcastReceiver: BroadcastReceiver:

public class IntentReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        // Do your stuff here.
    }
}

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

相关问题 如何使用 PackageInstaller 以编程方式卸载 android 中的应用程序 - How to uninstall apps in android programmatically with PackageInstaller 如何使用PackageInstaller for Profile Owner安装应用程序? - How to install app using PackageInstaller for Profile Owner? Lollipop上的“ PackageInstaller”类是什么,如何使用? - What's “PackageInstaller” class on Lollipop, and how to use it? 如何从PackageInstaller获取sideloaded APK的签名 - How to get signature of a sideloaded APK from PackageInstaller 使用 Android PackageInstaller 时如何获取状态? - How to get status when using Android PackageInstaller? 如何使用Android L中的“PackageInstaller”类安装/更新/删除APK? - How to install/update/remove APK using “PackageInstaller” class in Android L? 如何使用新的 PackageInstaller api 卸载 android 应用程序? - How to uninstall android apps using the new PackageInstaller api? 如何检测用户是否已确认在 PackageInstaller (Android) 中安装 - How to Detect if user has confirmed for installation in PackageInstaller (Android) Android会覆盖对话框以外的所有按钮样式 - Android override all button styles except dialogs 如何检查打开的对话框? - How to check for open dialogs?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM