2016-04-15 6 views
1

私はアンドロイドアプリケーションにWazeを統合したいと思っています。私は下のリンクからステップを踏んでいます。アンドロイド私のアプリをWazeと統合する

https://www.waze.com/about/dev#android_api

私が質問を検索し、これと同じものを見つけたが、それは、iOS以下

xcode and waze integration

のためである私が使用するコードです。

try 
      { 
       String url = "waze://?q=Hawaii"; 
       Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); 
       startActivity(intent); 
      } 
      catch (ActivityNotFoundException ex ) 
      { 
       Intent intent = 
         new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=com.waze")); 
       startActivity(intent); 
      } 

なぜ私はそれを実行すると次のエラーが発生しましたか?

Process: com.domain.appname, PID: 5711 
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=market://details?id=com.waze } 

答えて

11

変更

market://details?id=com.waze 

https://play.google.com/store/apps/details?id=com.waze 

に、あなたはまた、クラッシュ

intent.resolveActivity(getPackageManager()) != null

を避けるために、この検証を追加することができます
関連する問題