| | |
| | | import android.net.Uri; |
| | | import android.widget.Toast; |
| | | |
| | | import com.secondworld.sdk.GameApp; |
| | | import com.secondworld.sdk.GameAppProxy; |
| | | import com.secondworld.sdk.utils.CodeU2A; |
| | | import com.secondworld.sdk.utils.LogUtil; |
| | | |
| | |
| | | File file = new File(path); |
| | | if (!file.exists()) { |
| | | LogUtil.w("InstallApp", "文件不存在"); |
| | | Toast.makeText(GameApp.I, "找不安装文件", Toast.LENGTH_SHORT).show(); |
| | | Toast.makeText(GameAppProxy.app, "找不安装文件", Toast.LENGTH_SHORT).show(); |
| | | return; |
| | | } |
| | | Intent _intent = new Intent(Intent.ACTION_VIEW); |
| | | _intent.setDataAndType(Uri.fromFile(file), |
| | | "application/vnd.android.package-archive"); |
| | | _intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); |
| | | GameApp.I.startActivity(_intent); |
| | | GameAppProxy.app.startActivity(_intent); |
| | | } catch (Exception e) { |
| | | LogUtil.e("CmdInstallAPK", e); |
| | | } |