Do a Specific Task After Screen Unlock

I tired it and I am getting a runtime error Receiver not registered: xyz.kumaraswamy.activitylisner.ActivityReceiver@9805899

Try this: play_unlocked.apk (5.3 MB)

1 Like

That should not happen unless you are testing in a companion.
Where exactly it doesn’t work?

I just checked it.
The error only raises when you are calling the block two times as the receiver is already unregistered.

This should work fine:

O yeah It’s working Now
1 last Problem I am Facing Is that This only Works When App is running in Background (Recent apps) when i clear it from Their it Doesn’t work Any Solution.

Yeah this is possible, you just have to make them work with this extension:

A repeated mode will be needed to do it.

This does the same and works also with Companion:
play_unlocked2.aia (152.4 KB)

your background extension just flew above my head it’s to difficult to understand.
Can u just tell me which blocks should I use for my App
Which we discussed above just want to play music when user unlock his phone and I want that it should still work when user remove app from background(recent apps)

Sorry to hijack the topic, but I never saw those 2 extensions. Are they still in beta phase or are they available for anyone to use normally?

1 Like

@Xoma please create a new thread for each of these extensions in category #extensions and add a short documentation and how to use them etc… so everyone will be able to find the extensions later again when they are needed
thank you

Taifun

2 Likes

Those were quick extensions created by me. :sweat_smile:

Okay, do I need to create a new topic?

1 Like

I used your Method with some changes
1)Instead of button I used Switch which is working fine
2)Instead of Loop i only want music to play when user unlocks screen and Music should be played once Don’t want loop but it’s keep Looping can u find the mistake

See in the Designer settings (Player: loop). Disable it.

I disable it but it’s still looping

What exactly is to be achieved:

  1. open app
  2. Music is playing / not playing?
  3. The app goes to the background and / or the screen is locked
  4. Music is playing / not playing?
  5. The app comes to the foreground and / or the screen is unlocked

What is the purpose of the switch?

Let me Explain from Start

  1. If User Turn on Switch then A 2 Second music will be Played When he will unlock His Phone
  2. If User Turn Off Switch then No Music will be Played When he Unlock his Phone
    I want to Create App Something like this
    https://play.google.com/store/apps/details?id=salah.rasoulallah.com

User Will Only Open App When He Wants Music to Play When He Unlocks Phone
Or Want to Disable it Remaining Work will be Done in Background.
If you Download The Link I Gave you link you will Understand what i want

Sorry, but I really don’t have the time to install an unfamiliar app and learn Arabic (?) In order to understand what you want (your steps).

Is it really that difficult to explain this clearly:

  • Step 1: Do this …
  • Step 2: Do that …
1 Like

Step 1: User Download App and Open it
Step 2 : User Enable Switch from app
Step 3 : User lock his Phone & when he unlock his phone A music is played once Step 4 : Music should be played every time he unlock his phone
Step 5 : When user Turn off Switch no music will be played when he will unlock his phone
Hope you understand what I want to say

Try this: play_unlocked3.aia (145.9 KB)