Android Question Download apk and install

sigster

Active Member
Licensed User
Longtime User
Save the apk file is ok

when I try to install the apk I get this error

android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.INSTALL_PACKAGE dat=/storage/emulated/0/Download/tt.apk typ=application/vnd.android.package-archive flg=0x20000 }


B4X:
Public Sub ProcessData(data() As Byte) As ResumableSub
    Dim out As OutputStream = File.OpenOutput(File.DirRootExternal  & "/Download/", "tt.apk", False)
    out.WriteBytes(data, 0, data.Length)
    out.Close
    Return out   
End Sub


B4X:
Sub Install()
    Dim newintent As Intent
    newintent.Initialize("android.intent.action.INSTALL_PACKAGE", File.Combine(File.DirRootExternal  & "/Download/", "tt.apk"))
    newintent.SetType("application/vnd.android.package-archive")
    StartActivity(newintent)
    
End Sub
 
Top