public boolean subscribeTopic(@NonNull Context context,@NonNull String[] newTopics){
  if (!initialized)   init(context);
  if (newTopics.length == 0)   return false;
  if (null == topics) {
    topics=new ArrayList<>();
  }
  for (  String topic : newTopics) {
    if (topics.contains(topic)) {
      return false;
    }
    topics.add(topic);
  }
  saveSubscibedTopics(context);
  Intent intent=new Intent(context,RegistrationIntentService.class);
  intent.setAction(RegistrationIntentService.ACTION_SUBSCRIBE);
  intent.putExtra(RegistrationIntentService.EXTRA_TOPIC_LIST,newTopics);
  context.startService(intent);
  return true;
}

public boolean subscribeTopic ( @ NonNull Context context , @ NonNull String [ ] newTopics ) { if ( ! initialized ) init ( context ) ; if ( newTopics . length == 0 ) return false ; if ( null == topics ) { topics = new ArrayList < > ( ) ; } for ( String topic : newTopics ) { if ( topics . contains ( topic ) ) { return false ; } topics . add ( topic ) ; } saveSubscibedTopics ( context ) ; Intent intent = new Intent ( context , RegistrationIntentService . class ) ; intent . setAction ( RegistrationIntentService . ACTION_SUBSCRIBE ) ; intent . putExtra ( RegistrationIntentService . EXTRA_TOPIC_LIST , newTopics ) ; context . startService ( intent ) ; return true ; }
subscribe to a list of topics .
