removed unnecessary click
This commit is contained in:
parent
70ca8ebd2e
commit
7f3bce15d9
2 changed files with 12 additions and 5 deletions
|
@ -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);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue