Android中未保存的文件路径

时间:2017-09-14 12:09:41

标签: android

所以在我的应用程序中,图片是在购买时下载的,所以我把它们放在SD卡中,必须输入一个目录,之后会这样做。但是我需要在用户选择它时稍后访问它们。

Log.d(TAG, fileName.getPath());

我的代码是否用于在FilePath类中保存它们。它一直返回null,但是我使用了 /storage/emulated/0/scrtwo.png 并且它带回了路径

public class FilePath {
public String filePath1;
public String filePath2;
public String filePath3;
public String filePath4;
public String filePath5;
public String filePath6;
public String filePath7;
public String filePath8;
public String filePath9;
public String filePath10;


public FilePath(){}

public String getFilePath1() {
    return filePath1;
}

public void setFilePath1(String filePath1) {
    this.filePath1 = filePath1;
}

public String getFilePath2() {
    return filePath2;
}

public void setFilePath2(String filePath2) {
    this.filePath2 = filePath2;
}

public String getFilePath3() {
    return filePath3;
}

public void setFilePath3(String filePath3) {
    this.filePath3 = filePath3;
}

public String getFilePath4() {
    return filePath4;
}

public void setFilePath4(String filePath4) {
    this.filePath4 = filePath4;
}

public String getFilePath5() {
    return filePath5;
}

public void setFilePath5(String filePath5) {
    this.filePath5 = filePath5;
}

public String getFilePath6() {
    return filePath6;
}

public void setFilePath6(String filePath6) {
    this.filePath6 = filePath6;
}

public String getFilePath7() {
    return filePath7;
}

public void setFilePath7(String filePath7) {
    this.filePath7 = filePath7;
}

public String getFilePath8() {
    return filePath8;
}

public void setFilePath8(String filePath8) {
    this.filePath8 = filePath8;
}

public String getFilePath9() {
    return filePath9;
}

public void setFilePath9(String filePath9) {
    this.filePath9 = filePath9;
}

public String getFilePath10() {
    return filePath10;
}

public void setFilePath10(String filePath10) {
    this.filePath10 = filePath10;
}



@Override
public String toString() {
    return "FilePath{" +
            "filePath1='" + filePath1 + '\'' +
            ", filePath2='" + filePath2 + '\'' +
            ", filePath3='" + filePath3 + '\'' +
            ", filePath4='" + filePath4 + '\'' +
            ", filePath5='" + filePath5 + '\'' +
            ", filePath6='" + filePath6 + '\'' +
            ", filePath7='" + filePath7 + '\'' +
            ", filePath8='" + filePath8 + '\'' +
            ", filePath9='" + filePath9 + '\'' +
            ", filePath10='" + filePath10 + '\'' +
            '}';
}

这是这里的。任何人都知道为什么它没有被保存在我的二传手中?

此刻此刻非常混乱,但我会解决它。

x = 'Wish she could have told me herself. @NicoleScherzy #nicolescherzinger #OneLove #myfav #MyQueen :heavy_black_heart::heavy_black_heart: some string too :smiling_face:' 

0 个答案:

没有答案