Skip to content

Instantly share code, notes, and snippets.

Дальше в коде сделать так чтобы урл брался через 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");
@Aydogdyshka
Aydogdyshka / BlogRemoteMediator.kt
Last active March 16, 2021 18:20
Android-Paging3 - this is a gist for solving recyclerview items flickering and jumping when using network and database
@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 {