Skip to content

Commit

Permalink
Fixed errors on opening notes locations on some devices
Browse files Browse the repository at this point in the history
  • Loading branch information
federicoiosue committed Jun 18, 2014
1 parent c788672 commit a2e5408
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/it/feio/android/omninotes/DetailFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -614,14 +614,15 @@ public boolean onDrag(View v, DragEvent event) {
public void onClick(View v) {
String urlTag = Constants.TAG
+ (noteTmp.getTitle() != null ? System.getProperty("line.separator") + noteTmp.getTitle() : "")
+ (noteTmp.getContent() != null ? System.getProperty("line.separator") + noteTmp.getContent() : "");
// final String uriString = "http://maps.google.com/maps?q=" + noteTmp.getLatitude() + ',' + noteTmp.getLongitude() + "("
// + urlTag + ")&z=15";
final String uriString = "geo:" + noteTmp.getLatitude() + ',' + noteTmp.getLongitude()
+ (noteTmp.getContent() != null ? System.getProperty("line.separator") + noteTmp.getContent() : "");
String uriString = "geo:" + noteTmp.getLatitude() + ',' + noteTmp.getLongitude()
+ "?q=" + noteTmp.getLatitude() + ',' + noteTmp.getLongitude()
+ "(" + urlTag + ")";

Intent locationIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(uriString));
if (!IntentChecker.isAvailable(getActivity(), locationIntent, null)) {
uriString = "http://maps.google.com/maps?q=" + noteTmp.getLatitude() + ',' + noteTmp.getLongitude();
locationIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(uriString));
}
startActivity(locationIntent);
}
});
Expand Down

0 comments on commit a2e5408

Please sign in to comment.