//        TODO: this function is only used for >=API 8.0, so may be need to support other version's API
@Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
//        add MQTT listener
        MqttService.add_mqttListener(this);
//        need to bind the UI activity and the background service
        Intent intent=new Intent(getActivity(),MqttService.class);
//        change the current msg-->different page has different topic
//        TODO: may use '#' to receive all msg, and different listener to select the topic they need
        MqttService.setCur_topic("pic_data");
//        TODO: this function is only used for >=API 8.0, so may be need to support other version's API
        startForegroundService(getActivity(),intent);
    }
// TODO: may use '#' to receive all msg, and different listener to select the topic they need
MqttService.setCur_topic("pic_data");
// TODO: this function is only used for >=API 8.0, so may be need to support other version's API
startForegroundService(getActivity(),intent);
}
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// add MQTT listener
MqttService.add_mqttListener(this);
// need to bind the UI activity and the background service
Intent intent=new Intent(getActivity(),MqttService.class);
// change the current msg-->different page has different topic
// TODO: may use '#' to receive all msg, and different listener to select the topic they need
MqttService.setCur_topic("pic_data");
// TODO: this function is only used for >=API 8.0, so may be need to support other version's API
startForegroundService(getActivity(),intent);
}
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// add MQTT listener
MqttService.add_mqttListener(this);
// need to bind the UI activity and the background service
Intent intent=new Intent(getActivity(),MqttService.class);
// change the current msg-->different page has different topic
// TODO: may use '#' to receive all msg, and different listener to select the topic they need
MqttService.setCur_topic("pic_data");
// TODO: this function is only used for >=API 8.0, so may be need to support other version's API
startForegroundService(getActivity(),intent);
}