0

I have a MainActivity from which the user can enter an AddRecordActivity. Upon save, the user is returned to the MainActivity. Here I would like the user to see a snackbar confirming that the record has been saved (if it was saved properly)

Two spontaneous approaches;

1) Create a message service to which activities can post messages to. On the other end, the snackbar will popup until the queue is empty.

2) Use startActivityForResult()

Is there any other good way of doing this? Any ideas on what approach is most reasonable?

Naveen Kumar M
  • 7,497
  • 7
  • 60
  • 74
Poyan
  • 6,243
  • 6
  • 28
  • 30
  • you should use startActivityForResult() – Aakash Sep 17 '15 at 15:09
  • Is there a certain reason for this? – Poyan Sep 17 '15 at 15:10
  • why use service for implementing such a simple functionality,as services drain battery and you should try to implement functions which use least battery and memory usage to make your applications more optimized – Aakash Sep 17 '15 at 15:13
  • Doesn't need to be an android service, can be just a service class. – Poyan Sep 17 '15 at 15:37
  • what according to you is the meaning of service class,it is far better to use startActivityFor Result() as it does not depend on how long you say no other activity ,it will return the result as soon as your function is implemented – Aakash Sep 17 '15 at 15:46

0 Answers0