This is a bit confusing..
>
> Hallo
> I have a task
Do you mean A scene ?
Try setting the scene properties to activity. And show the scene as a activity.
which I want to keep in foreground. But if I get e.g. some message through another app, the task screen is gone after I close this other app.
> So I added a Notify (permanent) with a Perform Task Action. This Task is the same Task which is in background.
> But it doesn't work like this.
My guess would be you are getting a error because the scene you are trying to show has already been created.
Try adding a destroys scene action just before the show scene action.
>
could you post your exported descriptions?
To post your profile or task here... Long press on the profile or task name / ( 3 dot menu with 4.0+ ) export / export "DESCRIPTION" to clipboard (not XML)
Any linked tasks will be exported with the profile they are linked to..
To be able to export, The beginner mode needs to be off and the profile needs to be named by you (Not the Tasker listed name. Tasker will list your profile with the context name if you have not given it one).
This is a bit confusing..
>
> Hallo
> I have a taskDo you mean A scene ?
Try setting the scene properties to activity. And show the scene as a activity.
My guess would be you are getting a error because the scene you are trying to show has already been created.
Try adding a destroys scene action just before the show scene action.
could you post your exported descriptions?
Scene: MacMedia
P:1080x1920 L:-1x-1
Orientation: System
Background Colour: #FF000000
Action Bar Style: System
Title: MacMedia
Subtitle:
Icon: null
Tab Labels:
Events:
Key: 547
Element: Play/Button
Geometry:
P:302,1610 474x310 L:352,660 475x275
Content:
Label:
Label Size: 22
Label Width Scale %: 100
Label Colour: #FFFFFFFF
Font:
Position: Centre
Icon: hd_ab_av_play
Events:
Click: 463
LongClick: 464
Element: Quit/Button
Geometry:
P:0,1760 151x160 L:352,660 475x275
Content:
Label:
Label Size: 22
Label Width Scale %: 100
Label Colour: #FFFFFFFF
Font:
Position: Centre
Icon: hd_aaa_ext_io
Events:
Click: 465
LongClick: 466
...
Element: switch_host/Button
Geometry:
P:2,1335 299x125 L:352,660 475x275
Content:
Label: host
Label Size: 14
Label Width Scale %: 100
Label Colour: #FFFFFFFF
Font:
Position: Centre
Icon: null
Events:
Click: 545
LongClick: 546MacMedia (462)
Abort Existing Task
A1: Display Timeout [ Secs:0 Mins:0 Hours:1 ]
A2: Variable Set [ Name:%vol To:1 Do Maths:Off Append:Off ]
A3: Variable Set [ Name:%user To:f Do Maths:Off Append:Off ]
A4: Variable Set [ Name:%switch To:1 Do Maths:On Append:Off ]
A5: Variable Set [ Name:%host To:192.168.0.120 Do Maths:Off Append:Off ]
A6: Variable Set [ Name:%port To:22 Do Maths:Off Append:Off ]
A7: Variable Set [ Name:%click To:/opt/local/bin/cliclick Do Maths:Off Append:Off ]
A8: Notify [ Title:MacMedia Text:is still running Icon:hd_ab_av_play Number:0 Permanent:On Priority:3 Actions:(1) ]
A9: Destroy Scene [ Name:MacMedia ]
A10: Show Scene [ Name:MacMedia Display As:Activity, Full Window, No Bar Horizontal Position:100 Vertical Position:100 Animation:System Show Exit Button:Off Continue Task Immediately:Off ]
A11: Display Timeout [ Secs:0 Mins:2 Hours:0 ]
A12: Notify Cancel [ Title:MacMedia Warn Not Exist:Off ]
>> Try adding a destroys scene action just before the show scene action.
>
>
> Doesn't change things. I put directly before the Action "Show Scene" a "Destroy Scene" but not a change.
> I am not able to recall this app from my Notify, but neither from the "Recent Tasks" from Android.
> Collistion handling of the task ist Abort existing task.
>
> Funny thing: when I press the Recent Apps Button and press my (Tasker-)App (which I can indeed see in the list) then not the app opens but Tasker! Which is maybe a little bug in the App Factory.
Huh.. not sure about that one?? I can not reproduce that.
>
> Only when I start again the App through the App-Icon, then it runs. I close it and immediately it reopens again, depending how often I had pressed (in vain) the Button in the Notify.
Strange.. that almost sounds like the preform task is queing up the tasks like a event context would if you have 'enforce task order ' selected??
I will test that on my device later.
What priority do you have the preform task set for??
>
> When I run the Task from Tasker (not the App-Factory App of it) then the Notify Icon disappears, when I press the Home button. So this Notify only works with the App (-factory-app). Which seems strange to me too.
That actually goes along with what is happening in the app. It sounds like the task is being qued and not killed. So when the next itteration of the task is run the scene is destroyed and so the cancel notify runs..
This can be confirmed by checking the run log. Menu / more / run log
>
>
>
> >>
> >> Only when I start again the App through the App-Icon, then it runs. I
> >close it and immediately it reopens again, depending how often I had
> >pressed (in vain) the Button in the Notify.
> >
> >Strange.. that almost sounds like the perform task is queing up the
> >tasks
> >like a event context would if you have 'enforce task order ' selected??
>
> Where can I set this? ?
You can not. There is no setting . If this is what is happening then it would be a bug.
> >
> >This can be confirmed by checking the run log. Menu / more / run log
>
> Difficult, because it doesn't work at all out from tasker, as said. When I press home button the notify icon disappears, when run from tasker, the task exits then. No more task and no more icon.
I assume it is the tasker action that is cancelling the notify. Could you post the relevant part of the run log for the tasker portion. I relize this is not possible for the app.
>
> So I just need a way to bring a running app into the foreground, maybe my way with that notify is totally wrong and it is done better other way?
I believe this is the best method. I use this for several scenes without this issue..
Still doing some testting but the run log would be invaluable.
>
> This is the run log, when I start the task through a shortcut to that task on the home screen and press home button. The notify icon disappears then:
Ok, I misunderstood the issue. : I thought the notify was disapearing just after clicking on the notify button. The log shows things are working as expected. When you push the home button this destroys the scene and allows the task to continue so the notify cancel action runs..
The main issue here is that you have the 'continue task immediately' option disabled in the 'show scene action. The problem with that is you can not be sure of when your scene will be destroyed so you will get unreliable results. A better approach would be - once you show the scene then transfer control to the scene. In other words set the 'show scene' action to 'continue task immediately' and make it the last action in the task.
So in your case you could put the notify cancel action in your Quit/Button task.
I would start by making these changes and get the tasker end working first. Then see if it fixes the app.
Post back if this is not clear..
... The log shows things are working as expected. When you push the home button this destroys the scene
and allows the task to continue so the notify cancel action runs..
... The problem with that is you can not be sure of when your scene will be destroyed so you will get unreliable results.
>
> Then I misunderstood the scene. I thought the scene goes to the background like any other apps GUI too. When I press Home Button having any other app in foreground, they go to the background, waiting for me to open them again. Or waiting for Android OS to kill them because they are unused. But not in the next seconds like this scene. When I press then the Recent Apps Button, I can bring them back.
>
> How can I avoid then the scene from beeing destroyed?
> So that is my issue.
I am probably just confusing the issue. I should not have said the scene gets destroyed. If you check in the user guide you will find a scene has these states it can be in ( uncreated, hidden, visible, background (shown but currently not on screen)) your perception of how a scene shown as a activity is handled is probably correct for the most part. To be honest I do not know exactly how each state is handled. I do know that a scene is handled differently within a app from the factory and tasker.
So when you hit the home button I believe the scene goes to hidden or background ,(not sure which one) and this allows the task to continue. So you could simply test the scene at this point to figure out what state it is in then not do the notify cancel . I have always found it easier to avoid this all together and just transfer control to the scene itself.
The same goes for using the destroy scene action prior to the show scene action. The correct method is to test the scene then act accordingly. But some times it is just as easy to destroy it first because you will not get a error if you destroy a scene that is not created or shown but you will get a error if you show a scene that is already being shown.
>
So , I believe in theory once you show a scene as a activity it should persist until you destroy it with the tasker destroy scene action. And you should be able to simply re-show the scene (after testing the state) and still have all of your scene data in tact.
The key action you were missing is the 'test scene' action. If you do this at the beginning of the task you will then know if you want to just show the scene (IE the scene is in background or hidden) or if you want to set all your variables and then show the scene (IE the scene is uncreated) or do nothing (IE the scene is visable)
> Is that possible to set that somehow, to collapse the notification bar?
There is a tasker action for that.
You could put it at the begining of your task.
> Anyway, thanks for help appreciatedly!!
>
> frank
>
> --
> You received this message because you are subscribed to the Google Groups "Tasker" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to tasker+un...@googlegroups.com.
> Visit this group at https://groups.google.com/group/tasker.
> For more options, visit https://groups.google.com/d/optout.
> The key action you were missing is the 'test scene' action. If you do this at the beginning of the task you will then know if you want to just show the scene (IE the scene is in background or hidhden) or if you want to set all your variables and then show the scene (IE the scene is uncreated) or do nothing (IE the scene is visable)
I am not sure which sate will give you a error when trying to re-show the scene. You will have to test this. Turn on and check run log. You can also turn on 'show pop up errors' in the tasker preferences.
...
> Is that possible to set that somehow, to collapse the notification bar?
There is a tasker action for that.
You could put it at the begining of your task.