我需要实现一种方法,一旦用户到达设置的目的地,便将该用户发送到另一个活动。我尝试了onNavigationFinished()方法,但没有成功。谁能帮我吗?
public class RouteActivity extends AppCompatActivity implements OnMapReadyCallback, LocationEngineListener,
PermissionsListener, MapboxMap.OnMapClickListener, NavigationListener {
@Override
public void onNavigationFinished() {
Intent mainIntent = new Intent(RouteActivity.this, MainActivity.class);
mainIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
startActivity(mainIntent);
finish();
} }