removed unnecessary click

This commit is contained in:
Chumva 2018-05-25 11:41:36 +03:00
parent d493e5ef15
commit 1307b3e487
2 changed files with 12 additions and 5 deletions

View file

@ -136,10 +136,17 @@ public class WikivoyageArticleDialogFragment extends WikiArticleBaseDialogFragme
trackButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(Intent.ACTION_SEND);
intent.putExtra(Intent.EXTRA_TEXT, WikiArticleHelper.buildTravelUrl(article.getTitle().replace(" ", "%20"), article.getLang()));
intent.setType("text/plain");
startActivity(Intent.createChooser(intent, getString(R.string.shared_string_share)));
FragmentActivity activity = getActivity();
FragmentManager fm = getFragmentManager();
if (article == null || activity == null || fm == null) {
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);
}
});

View file

@ -180,7 +180,7 @@ public class WikivoyageExploreActivity extends TabActivity implements DownloadEv
&& path != null
&& host.contains("osmand.net")
&& path.startsWith("/travel")) {
String query = data.getQueryParameter("query");
String query = data.getQueryParameter("title");
String selectedLang = data.getQueryParameter("lang");
if (!Algorithms.isEmpty(query) && !Algorithms.isEmpty(selectedLang)) {
WikivoyageArticleDialogFragment.showInstance(app, getSupportFragmentManager(), query, selectedLang);