Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Sebelum on create
- RMQ rmq = new RMQ();
- private Thread subscribeThread;
- // Di On Create Tambahkan ini
- rmq.setupConnectionFactory();
- subscribeNotification();
- /**
- * Function for subscribe data from RMQ, for receiving callback
- * Buat fungsi baru di luar on create dkk
- */
- private void subscribeNotification() {
- final Handler incomingMessageHandler = new Handler() {
- @Override
- public void handleMessage(Message msg) {
- String title = "Pengumuman";
- String message = msg.getData().getString("msg");
- Log.d("RMQMessage", message);
- showNotification(title, message);
- }
- };
- rmq.subscribeNotification(incomingMessageHandler,subscribeThread);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement