Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,8 @@ public void onCreate(Bundle savedInstanceState) {
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
Bundle bundle = getArguments();
if (bundle != null) {
if (bundle.containsKey("url")) {
startUrl = bundle.getString("url");
}
if (bundle != null && bundle.containsKey("url")) {
startUrl = bundle.getString("url");
}
if (startUrl != null) {
updateUrl(startUrl);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,9 @@ private String up(String uri) {

public void back(WebView view) {
try {
if (path.size() > 1) {
if (!path.get(1).get("type").equals("list")) {
String newUrl = up(url);
shouldOverrideUrlLoading(view, newUrl);
}
if (path.size() > 1 && !path.get(1).get("type").equals("list")) {
String newUrl = up(url);
shouldOverrideUrlLoading(view, newUrl);
}
} catch (Exception e) {
Log.e(TAG, "Back button failed");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,13 +249,12 @@ public String getMimeFromExtension(Uri uri) {
}

public Uri stripExtension(Uri uri) {
if (uri.getLastPathSegment() != null) {
if (uri.getLastPathSegment().endsWith(".html")
|| uri.getLastPathSegment().endsWith(".json")) {
if (uri.getLastPathSegment() != null
&& (uri.getLastPathSegment().endsWith(".html")
|| uri.getLastPathSegment().endsWith(".json"))) {
String url = uri.toString();
Uri newUri = Uri.parse(url.substring(0, url.lastIndexOf(".")));
return newUri;
}
}
return uri;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,13 +216,11 @@ private File manageDatabase() {
try {
tmpFile = new File(context.getFilesDir().getAbsolutePath(), dbName);
// see if the db exists on internal storage
if (tmpFile.exists()) {
if (null != retFile) {
// if the db is on internal *and* external storage, delete
// the
// internal storage copy
tmpFile.delete();
}
if (tmpFile.exists() && null != retFile) {
// if the db is on internal *and* external storage, delete
// the
// internal storage copy
tmpFile.delete();
}

// if we got this far with retFile undefined, there either isn't
Expand Down