Android Question intent = Intent.getIntent

Discussion in 'Android Questions' started by little3399, Jan 25, 2015.

  1. little3399

    little3399 Active Member Licensed User

    Hi, Erel

    How does I can using the command in B4A , intent = Intent.getIntent ... Tks!

    this command ... was is Baidu Map ... http://developer.baidu.com/map/index.php?title=uri/api/android


    //调起百度地图客户端(Android)展示上海市"28"路公交车的检索结果
    intent = Intent.getIntent("intent://map/line?coordtype=&zoom=&region=上海&name=28&src=yourCompanyName|yourAppName#Intent;scheme=bdapp;package=com.baidu.BaiduMap;end");
    startActivity(intent); //启动调用


    or in this method

    Intent intent = new Intent(Intent.ACTION_VIEW);
    Uri uri = Uri.parse("geo:39.922840,116.3543240,北京市西城区阜外大街2号万通大厦");
    intent.setData(uri);
    intent.setPackage("com.baidu.BaiduMap");
    this.startActivity(intent);
     
    Last edited: Jan 25, 2015
  2. ivan.tellez

    ivan.tellez Active Member Licensed User

    This is easy with the Intent object, there are lots of examples in the forum, this is just like the intent used to the google maps.

    Just use the search function of the forum
     
  3. Erel

    Erel Administrator Staff Member Licensed User

    Please don't limit your questions to a single member.

    Just pass the url as the second parameter.
     
    Peter Simpson likes this.
  4. little3399

    little3399 Active Member Licensed User

    Hi,
    I using the follow code ... using URI method call another app , but it show following message ... need Help ...

    B4A code :

    Dim In As Intent
    Dim pm As PackageManager

    Dim Bd_uri As String="intent://map/geocoder?address=北京市海淀区上地信息路9号奎科科技大厦&src=urc|B4ATest#Intent;scheme=bdapp;package=com.baidu.BaiduMap;end"
    In.Initialize(In.ACTION_VIEW,Bd_uri)
    In.SetComponent("com.baidu.BaiduMap")
    If In.IsInitialized Then
    StartActivity(In)
    End If


    Java Code :

    //
    intent = Intent.getIntent("intent://map/geocoder?address=北京市海淀区上地信息路9号奎科科技大厦&src=yourCompanyName|yourAppName#Intent;scheme=bdapp;package=com.baidu.BaiduMap;end");
    startActivity(intent);

    Error message ...
     

    Attached Files:

  5. Erel

    Erel Administrator Staff Member Licensed User

    Remove this string from the URL: %src=urc...:
    Code:
    Dim Bd_uri As String="intent://map/geocoder?address=北京市海淀区上地信息路9号奎科科技大厦"
     
  6. little3399

    little3399 Active Member Licensed User

    Hi, Erel

    I have already adjusted according to your advice... but the result still the same

    upload_2015-2-12_16-33-5.png
     
  7. Erel

    Erel Administrator Staff Member Licensed User

    You can use JavaObject to run this Java code exactly:
    Code:
    Dim jo As JavaObject
    Dim in As Intent = jo.InitializeStatic("android.content.Intent").RunMethod("getIntent"Array("long string here"))
    StartActivity(in)
     
  8. little3399

    little3399 Active Member Licensed User

    Tks , Erel , use JavaObject can be work very well ... :)
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice