Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. *NotificationHelper
  2. Todo todo;
  3.  
  4. new Thread(new Runnable() {
  5. @Override
  6. public void run() {
  7. long string = System.currentTimeMillis();
  8. test(string);
  9. }
  10. }).start();
  11.  
  12.  
  13. NotificationCompat.Action send_wa=
  14. new NotificationCompat.Action.Builder(
  15. 0, "Send WhatApps", DismisPendingIntent
  16. ).build();
  17.  
  18. return new NotificationCompat.Builder(getApplicationContext(), channelID)
  19. .setContentTitle(todo.clock)//get_Clock_from_Room
  20. .setContentText("get_Detail_from_Room")
  21. .addAction(send_wa)
  22. .setSmallIcon(R.drawable.ic_logo);
  23.  
  24.  
  25. @SuppressLint("StaticFieldLeak")
  26. private void test(Long clock){
  27. new AsyncTask<Long, Void, List<Todo>>(){
  28. @Override
  29. protected List<Todo> doInBackground(Long... params) {
  30. return myDatabase.daoAccess().fetchTodoListByClock(params[0]);
  31. }
  32. }.execute(clock);
  33. }
  34.  
  35. *DaoAccess
  36.  
  37. @Query("SELECT * FROM " + MyDatabase.TABLE_NAME_TODO + " WHERE clock = :clock")
  38. List<Todo> fetchTodoListByClock(Long Clock);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement