This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Дальше в коде сделать так чтобы урл брался через FileProvider вместо file:// | |
public class ApkInstaller { | |
public static void installApk(Context context, String apkFilePath) { | |
File apkFile = new File(apkFilePath); | |
Uri apkUri = FileProvider.getUriForFile(context, context.getApplicationContext().getPackageName() + ".fileprovider", apkFile); | |
Intent intent = new Intent(Intent.ACTION_VIEW); //Сделайте так обратно плиз | |
intent.setDataAndType(apkUri, "application/vnd.android.package-archive"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ExperimentalPagingApi | |
class BlogsRemoteMediator(private val categoryId: Int, | |
private val service: NewsAPIInterfaceKt, | |
private val newsDatabase: NewsDatabaseKt, | |
private val tagId : Int? = null , | |
private val initialPage:Int = 1 | |
) : RemoteMediator<Int, Blog>() { | |
override suspend fun initialize(): InitializeAction { |