Fix activity not found
This commit is contained in:
parent
aaf4d7ad8c
commit
e462afc10e
3 changed files with 10 additions and 4 deletions
|
@ -8,6 +8,7 @@ import android.graphics.PorterDuff;
|
|||
import android.graphics.Typeface;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.support.v4.content.FileProvider;
|
||||
|
@ -535,8 +536,10 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
|
|||
}
|
||||
|
||||
private void importFavourites() {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
((FavoritesActivity) getActivity()).importFavourites();
|
||||
}
|
||||
}
|
||||
|
||||
public void shareFavorites(final FavoriteGroup group) {
|
||||
final AsyncTask<Void, Void, Void> exportTask = new AsyncTask<Void, Void, Void>() {
|
||||
|
|
|
@ -529,8 +529,10 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
|
|||
}
|
||||
|
||||
private void addTrack() {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
((FavoritesActivity) getActivity()).addTrack();
|
||||
}
|
||||
}
|
||||
|
||||
public void showProgressBar() {
|
||||
((FavoritesActivity) getActivity()).setSupportProgressBarIndeterminateVisibility(true);
|
||||
|
|
|
@ -10,6 +10,7 @@ import android.graphics.drawable.Drawable;
|
|||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.RequiresApi;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.support.v4.view.ViewPager;
|
||||
import android.support.v7.widget.SearchView;
|
||||
|
@ -83,14 +84,14 @@ public class FavoritesActivity extends TabActivity {
|
|||
}
|
||||
}
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.KITKAT)
|
||||
@RequiresApi(Build.VERSION_CODES.KITKAT)
|
||||
public void addTrack() {
|
||||
Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
|
||||
intent.setType("*/*");
|
||||
startActivityForResult(intent, OPEN_GPX_DOCUMENT_REQUEST);
|
||||
}
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.KITKAT)
|
||||
@RequiresApi(Build.VERSION_CODES.KITKAT)
|
||||
public void importFavourites() {
|
||||
Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
|
||||
intent.setType("*/*");
|
||||
|
|
Loading…
Reference in a new issue