-
Notifications
You must be signed in to change notification settings - Fork 14
Own function in Point screen
Jiří M. aka Menion edited this page Mar 18, 2019
·
3 revisions
Locus API offers an option to register own action in the menu of opened point screen. Thanks to this, when tapped your application receive full point object that user currently works with.
1a. For all points: register intent-filter in your activity
<intent-filter>
<action android:name="locus.api.android.INTENT_ITEM_POINT_TOOLS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
1b. For geocaches only: register intent-filter for your activity
<intent-filter>
<action android:name="locus.api.android.INTENT_ITEM_POINT_TOOLS" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="locus" />
<data android:path="menion.android.locus/point_geocache" />
</intent-filter>
2. Handle received click in your activity as follows:
public override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
...
// check intent that started activity
if (IntentHelper.isIntentPointTools(intent)) {
// load whole track
val pt = IntentHelper.getPointFromIntent(this, intent)
if (pt != null) {
// we have point, have fun
} else {
// problem with loading of the point
}
}
}
-
Basics
-
Non-API tools
-
Using API
-
Work with points
-
Work with tracks
-
Integration into Locus Map
-
Other/advanced features