Advertisement
Guest User

Untitled

a guest
Jul 20th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. Intent intent = getIntent();
  2. String action = intent.getAction();
  3. if (Intent.ACTION_VIEW.equals(action))
  4. {
  5. loadProfile(getIntent().getData());
  6. }
  7. else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT)
  8. {
  9. Intent openIntent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
  10. openIntent.setType("*/*");
  11. try
  12. {
  13. startActivityForResult(openIntent, OPEN_DOCUMENT);
  14. }
  15. catch (ActivityNotFoundException e)
  16. { /* some devices are unable to browse for files */
  17. finish();
  18. return;
  19. }
  20. }
  21.  
  22. private void loadProfile(Uri uri)
  23. {
  24. ...
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement