install apk from url

后端 未结 3 434
难免孤独
难免孤独 2021-01-02 15:57

I am trying to install an APK from a URL. This is my code:

Intent promptInstall = new Intent(android.content.Intent.         


        
3条回答
  •  别那么骄傲
    2021-01-02 16:33

    This won't help if the app is not available on the mearketplace, but in case it is:

    Uri marketUri = Uri.parse("market://search?q=pname:com.appmaker.tefloukipackage");
    Intent marketIntent = new Intent(Intent.ACTION_VIEW, marketUri);
    try {
        context.startActivity(marketIntent);
    } catch (ActivityNotFoundException ex) {
        showAlertDialog(context, "Error", "Could not launch the market application.", true, null);
    }
    

提交回复
热议问题