forked from upstream-mirrors/OpenTracks
Reuse track_id_broadcast_extra in MyTracksLib third_party.xml rather than add a new constant with the same value.
This commit is contained in:
@@ -176,12 +176,6 @@ public abstract class Constants {
|
|||||||
public static final String RESUME_TRACK_EXTRA_NAME =
|
public static final String RESUME_TRACK_EXTRA_NAME =
|
||||||
"com.google.android.apps.mytracks.RESUME_TRACK";
|
"com.google.android.apps.mytracks.RESUME_TRACK";
|
||||||
|
|
||||||
/**
|
|
||||||
* The name of extra to hold the Track ID when sharing the track
|
|
||||||
*/
|
|
||||||
public static final String TRACK_ID =
|
|
||||||
"com.google.android.apps.mytracks.TRACK_ID";
|
|
||||||
|
|
||||||
public static int getActionFromMenuId(int menuId) {
|
public static int getActionFromMenuId(int menuId) {
|
||||||
switch (menuId) {
|
switch (menuId) {
|
||||||
case Constants.MENU_SHARE_KML_FILE:
|
case Constants.MENU_SHARE_KML_FILE:
|
||||||
|
|||||||
@@ -16,7 +16,6 @@
|
|||||||
package com.google.android.apps.mytracks.io.file;
|
package com.google.android.apps.mytracks.io.file;
|
||||||
|
|
||||||
import static com.google.android.apps.mytracks.Constants.TAG;
|
import static com.google.android.apps.mytracks.Constants.TAG;
|
||||||
import static com.google.android.apps.mytracks.Constants.TRACK_ID;
|
|
||||||
|
|
||||||
import com.google.android.apps.mytracks.Constants;
|
import com.google.android.apps.mytracks.Constants;
|
||||||
import com.google.android.apps.mytracks.content.MyTracksProviderUtils;
|
import com.google.android.apps.mytracks.content.MyTracksProviderUtils;
|
||||||
@@ -140,7 +139,7 @@ public class SaveActivity extends Activity {
|
|||||||
shareIntent.setType(format.getMimeType());
|
shareIntent.setType(format.getMimeType());
|
||||||
Uri u = Uri.fromFile(new File(writer.getAbsolutePath()));
|
Uri u = Uri.fromFile(new File(writer.getAbsolutePath()));
|
||||||
shareIntent.putExtra(Intent.EXTRA_STREAM, u);
|
shareIntent.putExtra(Intent.EXTRA_STREAM, u);
|
||||||
shareIntent.putExtra(TRACK_ID, trackId);
|
shareIntent.putExtra(getString(R.string.track_id_broadcast_extra), trackId);
|
||||||
startActivity(Intent.createChooser(shareIntent,
|
startActivity(Intent.createChooser(shareIntent,
|
||||||
getResources().getText(R.string.share_track).toString()));
|
getResources().getText(R.string.share_track).toString()));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user