private boolean startRandomGame(){
  AbstractLaunch[] pins=mCardAdapter.getLaunchers();
  List<AbstractLaunch> games=new ArrayList<AbstractLaunch>(pins.length);
  for (  AbstractLaunch pin : pins) {
    if (pin.isGame()) {
      if (pin.mState == AbstractLaunch.STATE_READY) {
        games.add(pin);
      }
    }
  }
  if (games.size() > 0) {
    Random r=new Random();
    int index=r.nextInt(games.size());
    AbstractLaunch game=games.get(index);
    Log.d(TAG,String.format("Picked a game at random [%s]",game.mContentDescription));
    game.onClick(game.getClickTarget());
    MeasurementManager.recordCustomEvent(mMeasurement,getString(R.string.analytics_event_category_launch),getString(R.string.analytics_launch_action_voice),game.mContentDescription);
    AnalyticsManager.sendEvent(R.string.analytics_event_category_launch,R.string.analytics_launch_action_voice,game.mContentDescription);
    return true;
  }
 else {
    return false;
  }
}

private boolean startRandomGame ( ) { AbstractLaunch [ ] pins = mCardAdapter . getLaunchers ( ) ; List < AbstractLaunch > games = new ArrayList < AbstractLaunch > ( pins . length ) ; for ( AbstractLaunch pin : pins ) { if ( pin . isGame ( ) ) { if ( pin . mState == AbstractLaunch . STATE_READY ) { games . add ( pin ) ; } } } if ( games . size ( ) > 0 ) { Random r = new Random ( ) ; int index = r . nextInt ( games . size ( ) ) ; AbstractLaunch game = games . get ( index ) ; Log . d ( TAG , String . format ( "Picked a game at random [%s]" , game . mContentDescription ) ) ; game . onClick ( game . getClickTarget ( ) ) ; MeasurementManager . recordCustomEvent ( mMeasurement , getString ( R . string . analytics_event_category_launch ) , getString ( R . string . analytics_launch_action_voice ) , game . mContentDescription ) ; AnalyticsManager . sendEvent ( R . string . analytics_event_category_launch , R . string . analytics_launch_action_voice , game . mContentDescription ) ; return true ; } else { return false ; } }
pick a game at random from the available games in state_ready state
