0
このコードを使用しようとしています。ファイルが見つかりませんAndroidファイルをコピー中の例外
public synchronized void onActivityResult(final int requestCode, int resultCode,
final Intent data) {
String filePath = null;
if (resultCode == Activity.RESULT_OK) {
switch (requestCode) {
case RESULT_MEMORY_SAVE:
filePath = data.getDataString();
copyFileForReceipts(filePath,pathOfReceipts);
今filePathには文字列で、デバッガは、私がこれを使用しようとしています"content://media/external/images/media/133"
次のようにその値を示しています
sourceLocation = filePath;
File afile = new File(sourceLocation);
File bfile = new File(targetLocation + "file.jpg");
inStream = new FileInputStream(afile.getName()); //Gives exception
outStream = new FileOutputStream(bfile.getName());
ITSはFileNotFound
例外の例外を提供します。私も.getName()
を削除しようとしました。
どこが間違っているか教えてください。
よろしく