Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Intent intent = getIntent();
- String action = intent.getAction();
- if (Intent.ACTION_VIEW.equals(action))
- {
- loadProfile(getIntent().getData());
- }
- else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT)
- {
- Intent openIntent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
- openIntent.setType("*/*");
- try
- {
- startActivityForResult(openIntent, OPEN_DOCUMENT);
- }
- catch (ActivityNotFoundException e)
- { /* some devices are unable to browse for files */
- finish();
- return;
- }
- }
- private void loadProfile(Uri uri)
- {
- ...
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement