removed unnecessary click
This commit is contained in:
parent
d493e5ef15
commit
1307b3e487
2 changed files with 12 additions and 5 deletions
|
@ -136,10 +136,17 @@ public class WikivoyageArticleDialogFragment extends WikiArticleBaseDialogFragme
|
||||||
trackButton.setOnClickListener(new View.OnClickListener() {
|
trackButton.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
Intent intent = new Intent(Intent.ACTION_SEND);
|
FragmentActivity activity = getActivity();
|
||||||
intent.putExtra(Intent.EXTRA_TEXT, WikiArticleHelper.buildTravelUrl(article.getTitle().replace(" ", "%20"), article.getLang()));
|
FragmentManager fm = getFragmentManager();
|
||||||
intent.setType("text/plain");
|
if (article == null || activity == null || fm == null) {
|
||||||
startActivity(Intent.createChooser(intent, getString(R.string.shared_string_share)));
|
return;
|
||||||
|
}
|
||||||
|
TravelDbHelper dbHelper = getMyApplication().getTravelDbHelper();
|
||||||
|
File path = dbHelper.createGpxFile(article);
|
||||||
|
Intent newIntent = new Intent(activity, getMyApplication().getAppCustomization().getTrackActivity());
|
||||||
|
newIntent.putExtra(TrackActivity.TRACK_FILE_NAME, path.getAbsolutePath());
|
||||||
|
newIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||||
|
startActivity(newIntent);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -180,7 +180,7 @@ public class WikivoyageExploreActivity extends TabActivity implements DownloadEv
|
||||||
&& path != null
|
&& path != null
|
||||||
&& host.contains("osmand.net")
|
&& host.contains("osmand.net")
|
||||||
&& path.startsWith("/travel")) {
|
&& path.startsWith("/travel")) {
|
||||||
String query = data.getQueryParameter("query");
|
String query = data.getQueryParameter("title");
|
||||||
String selectedLang = data.getQueryParameter("lang");
|
String selectedLang = data.getQueryParameter("lang");
|
||||||
if (!Algorithms.isEmpty(query) && !Algorithms.isEmpty(selectedLang)) {
|
if (!Algorithms.isEmpty(query) && !Algorithms.isEmpty(selectedLang)) {
|
||||||
WikivoyageArticleDialogFragment.showInstance(app, getSupportFragmentManager(), query, selectedLang);
|
WikivoyageArticleDialogFragment.showInstance(app, getSupportFragmentManager(), query, selectedLang);
|
||||||
|
|
Loading…
Reference in a new issue