Originariamente inviato da
tanjian
ciao a tutti,
qualcuno sa come scrivere un pezzo di codice che richiama andnav2 da un altra applicazione?
grazie
codice:
// Only AndNav2 will react!
public static final String ANDNAV2_VIEW_ACTION =
"org.andnav2.intent.ACTION_VIEW";
private void sampleLocationRequest() {
// Create a bundle that will transfer the location-information
final Bundle b = new Bundle();
final ArrayList locations = new ArrayList();
// Add as many locations as you want here
// "Latitude,Longitude;Title;Description"
locations.add("50.119539,8.658031;Frankfurt;City Center");
// "Latitude,Longitude;Title;Description"
locations.add("50.133089,8.66729;Frankfurt (title is optional);"
+ "Just an optional description.. put anything here =) !!");
// "Latitude,Longitude;Title"
locations.add("50.133089,8.63729;Just a title, no decription");
// "Latitude,Longitude"
locations.add("50.124089,8.64729");
// Add the locations to the bungle using "locations" as the key
b.putStringArrayList("locations", locations);
// Create and broadcast an Intent that will
// start an AndNav-Map with the locations marked
final Intent locationIntent = new Intent(ANDNAV2_VIEW_ACTION);
locationIntent.putExtras(b);
sendBroadcast(locationIntent);
}
L'ho preso direttamente dal sito di andnav : AndNav.org - Android Navigation System