Код: Выделить всё
new ActivityResultCallback\() {
@Override
public void onActivityResult(Uri uri) {
// Handle the returned Uri
}
@Override
public void onCreate(@Nullable Bundle saveInstanceState) {
Код: Выделить всё
// ...
Button selectButton = findViewById(R.id.select_button);
selectButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
// Pass in the mime type you want to let the user select
// as the input
mGetContent.launch("image/\*");
}
});
Подробнее здесь: https://stackoverflow.com/questions/798 ... -insurance
Мобильная версия