Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ユーザーがテキスト ファイルを開くと、アプリケーションを選択する [開く] ダイアログが表示されます ([デフォルトで使用] を選択する場合もあります)。そこから、ユーザーが選択したファイルへのパスを取得するにはどうすればよいですか?
getIntent().getData()Uriユーザーが開いたものに関連付けられたを返します。次に、を使用しContentResolverて、そのコンテンツをストリームとして取得できます。
getIntent().getData()
Uri
ContentResolver