Skip to content

Instantly share code, notes, and snippets.

@alexzaitsev
alexzaitsev / PhotosUriResolver.java
Last active January 18, 2024 21:13
Get image/video file path from New Google Photos app Uri
if (isNewGooglePhotosUri(uri)) {
String pathUri = uri.getPath();
String newUri = pathUri.substring(pathUri.indexOf("content"), pathUri.lastIndexOf("/ACTUAL"));
return getDataColumn(context, Uri.parse(newUri), null, null);
}
public static boolean isNewGooglePhotosUri(Uri uri) {
return "com.google.android.apps.photos.contentprovider".equals(uri.getAuthority());
}
@skyfishjy
skyfishjy / CursorRecyclerViewAdapter.java
Last active December 16, 2023 08:55
CursorRecyclerViewAdapter
/*
* Copyright (C) 2014 skyfish.jy@gmail.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software