解决方案 »

  1.   

    /**
     * 
     * @param apk the apk file path
     * @return true,if install successfully else false
     */
    public static boolean InstallApkSlience(String apk)
    {
    Log.d(TAG, "install "+apk+" silence");
    boolean flag = true;
    String cmd="pm install -r "+apk;
    try {
    Process process = Runtime.getRuntime().exec(cmd);
    process.waitFor();
    process.destroy();
    } catch (Exception e) {
    flag = false;
    e.printStackTrace();
    }
    return flag;
    }