blob: 39f4cdc79d7b4ff6419320e10fa99f651fc63346 [file] [log] [blame]
package com.example.creation;
import android.app.Activity;
import com.google.firebase.appindexing.Action;
import com.google.firebase.appindexing.FirebaseAppIndex;
import com.google.firebase.appindexing.FirebaseUserActions;
import com.google.firebase.appindexing.Indexable;
import com.google.firebase.appindexing.builders.Actions;
public class MainActivity extends Activity {
/**
* ATTENTION: This was auto-generated to implement the App Indexing API.
* See https://g.co/AppIndexing/AndroidStudio for more information.
*/
public Action getIndexApiAction() {
return Actions.newView("Main", "http://www.example.com/main");
}
@Override
public void onStart() {
super.onStart();
// ATTENTION: This was auto-generated to implement the App Indexing API.
// See https://g.co/AppIndexing/AndroidStudio for more information.
FirebaseAppIndex.getInstance().update(new Indexable.Builder().setName("Main").setUrl("http://www.example.com/main").build());
FirebaseUserActions.getInstance().start(getIndexApiAction());
}
@Override
public void onStop() {
// ATTENTION: This was auto-generated to implement the App Indexing API.
// See https://g.co/AppIndexing/AndroidStudio for more information.
FirebaseUserActions.getInstance().end(getIndexApiAction());
super.onStop();
}
}