Skip to content

Commit

Permalink
修复bug
Browse files Browse the repository at this point in the history
  • Loading branch information
burgessjp committed Oct 12, 2017
1 parent e656153 commit 5947433
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Expand Up @@ -8,8 +8,8 @@ android {
applicationId "ren.solid.ganhuoio"
minSdkVersion 14
targetSdkVersion 25
versionCode 310
versionName "3.1.0"
versionCode 311
versionName "3.1.1"
}
buildTypes {
debug {
Expand Down
17 changes: 15 additions & 2 deletions app/src/main/java/ren/solid/ganhuoio/bean/Daily.java
Expand Up @@ -20,8 +20,21 @@ public class Daily {

public String getImgUrl() {
int start = content.indexOf("src=\"") + 5;
int end = content.indexOf(".jpg") + 4;
return content.substring(start, end);

int jpgEnd = content.indexOf(".jpg");
int end = jpgEnd + 4;
if (jpgEnd == -1) {
jpgEnd = content.indexOf(".jpeg");
end = jpgEnd + 5;
}
if (jpgEnd == -1) {
jpgEnd = content.indexOf(".png");
end = jpgEnd + 4;
}
if (end > start)
return content.substring(start, end);
else
return "";
}


Expand Down

0 comments on commit 5947433

Please sign in to comment.