0

I want to execute the Python scripts(that displays a toast and notification) in Android using sl4a. Can I show a toast message and a notification simultaneously? I m using an emulator for testing.

user1637909
  • 173
  • 1
  • 3
  • 14
  • Yes, of course. Did you give a try? – waqaslam Sep 19 '12 at 07:47
  • Yes, but just wanted to clarify as i am able to see either toast or notification. – user1637909 Sep 19 '12 at 07:52
  • are you able to see? or not? post your code... – waqaslam Sep 19 '12 at 08:04
  • I have the script(1 toast, 1 notification) to be executed as a String array which is passed to a Service(am using ASE). It writes my script to internal memory and launches the Python Interpreter. But my II script over-rides the first file in memory. So i m able to see notification twice. – user1637909 Sep 19 '12 at 08:12
  • Then it has nothing to do specifically with showing notification and toast. Its a problem with other parts of your code. Post a new question regarding that problem and see what help you can find – waqaslam Sep 19 '12 at 08:15

1 Answers1

0

Yes, it is possible to use a toast and a notification at the same time.

Although it may be not the best user experience in my opinion.

Toast is a way to let the user know of something while he'she is looking at the screen and is low priority. It goes away in a while.

Notification is a way to let the user know about something which is higher priority than a toast. It may be at a time where user's primary focus is not your app, or the device is sleeping as well. User can go to the notification drawer and see what's new with your app with this.

In most use cases, one of them does the job. I'm not sure why you need both.. at the same time. Doesn't a single notification cut it ?

Madushan
  • 6,977
  • 31
  • 79