答えを見つけたので、別のソースからコードをコピーしました。私はちょうど私の主な活動のパッケージ名と一致するapp.facebook.android.com.googlemapsを変更しなければならなかった
@Override
protected void onStart() {
googleApiClient.connect();
super.onStart();
// ATTENTION: This was auto-generated to implement the App Indexing API.
// See https://g.co/AppIndexing/AndroidStudio for more information.
Action viewAction = Action.newAction(
Action.TYPE_VIEW, // TODO: choose an action type.
"Map Page", // TODO: Define a title for the content shown.
// TODO: If you have web page content that matches this app activity's content,
// make sure this auto-generated web page URL is correct.
// Otherwise, set the URL to null.
Uri.parse("http://host/path"),
// TODO: Make sure this auto-generated app URL is correct.
Uri.parse("android-app://app.facebook.android.com.googlemaps/http/host/path")
);
AppIndex.AppIndexApi.start(googleApiClient, viewAction);
}
:これは次のように例外を投げていたONSTART方法が見えた方法です。