public boolean isUriReturnedForThirdApp() { String action = getIntent().getAction(); if (action != null) { return action.equals(Intent.ACTION_GET_CONTENT) || action.equals(MediaStore.Audio.Media.RECORD_SOUND_ACTION); } else { return false; } }
private void selectFile() { Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT); intent.addCategory(Intent.CATEGORY_OPENABLE); intent.setType("text/comma-separated-values"); intent.putExtra(Intent.EXTRA_LOCAL_ONLY, true); startActivityForResult(intent, CODE_SELECT_FILE); }
时间: 2024-11-18 04:03:13