Fix osmo issues
This commit is contained in:
parent
e79e8190be
commit
13dfd5b443
3 changed files with 15 additions and 0 deletions
|
@ -248,6 +248,16 @@ public abstract class OsmandPlugin {
|
|||
return null;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <T extends OsmandPlugin> T getPlugin(Class<T> clz) {
|
||||
for(OsmandPlugin lr : getAvailablePlugins()) {
|
||||
if(clz.isInstance(lr)){
|
||||
return (T) lr;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static List<String> onIndexingFiles(IProgress progress) {
|
||||
List<String> l = new ArrayList<String>();
|
||||
for (OsmandPlugin plugin : getEnabledPlugins()) {
|
||||
|
|
|
@ -147,6 +147,10 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
|
|||
super.onCreate(icicle);
|
||||
app = (OsmandApplication) getApplication();
|
||||
osMoPlugin = OsmandPlugin.getEnabledPlugin(OsMoPlugin.class);
|
||||
if(osMoPlugin == null) {
|
||||
osMoPlugin = OsmandPlugin.getPlugin(OsMoPlugin.class);
|
||||
OsmandPlugin.enablePlugin(this, app, osMoPlugin, true);
|
||||
}
|
||||
if(getIntent() != null) {
|
||||
if("http".equals(getIntent().getScheme())) {
|
||||
new OsMoIntentHandler(app, osMoPlugin).execute(getIntent());
|
||||
|
|
|
@ -97,6 +97,7 @@ public class OsMoPlugin extends OsmandPlugin implements OsMoReactor {
|
|||
@Override
|
||||
public void disable(OsmandApplication app) {
|
||||
super.disable(app);
|
||||
tracker.disableTracker();
|
||||
service.disconnect();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue