[英]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.