Private void startdirections ctions (data ){
Location = currentvalue. getdevlocation (this );
String saddr = string. Format ("% F, % F", location. getlatitude (),
Location. getlongpolling ());
String daddr = data. getbusiness (). getaddress () + ","
+ Getcszforsearch (data );
If (data. getlate6 ()! = 0
& Data. getlone6 ()! = 0 ){
Daddr = string. Format ("% F, % F ",
CDATA. getlate6 ()/000000f, Data. getlone6 ()/000000f );
}
Startgoogledirections (this, saddr, daddr );
}
Public static void startgoogledirections ctions (activity, string saddr,
String daddr ){
Uri. Builder = new URI. Builder ();
Builder. encodedpath ("http://maps.google.com/maps ")
. Appendqueryparameter ("F", "D ")
. Appendqueryparameter ("Hl", "en ");
// From can be null
If (! Isempty (saddr )){
Builder. appendqueryparameter ("saddr", saddr );
}
// To can be null
If (! Isempty (daddr )){
Builder. appendqueryparameter ("daddr", daddr );
}
Uri uri = URI. parse (builder. Build (). tostring ());
Intent I = new intent (intent. action_view, Uri );
If (I! = NULL ){
I. addflags (intent. flag_activity_new_task
& Intent. flag_activity_exclude_from_recents );
Activity. startactivityforresult (I, 0 );
}
}