-1

I want to make application in android in which when user clicks on gallery icon or message icon then it will a show a page asking for pattern lock and if user successfully enter's the pattern lock then it will open gallery or message. I was thinking to receive broadcast when someone clicks on gallery or message icon and then open my application from where user have to enter password and if password matches then it will intent to gallery or message . Friends Please Help.

Tarandeep Singh
  • 59
  • 1
  • 1
  • 7

1 Answers1

1

You can not receive broadcast when user open any installed application. System does not broadcast this intent. So you can only start service in background and check frequently user have opened any new application

you can use following link for reference,

check currently opened application

Community
  • 1
  • 1
kiran boghra
  • 3,662
  • 2
  • 18
  • 23
  • Thanks for your help. But according to your answer, my application service is going in background and it will record the names of open applications. that means after opening application my service will start but that will not solve my problem. as user has already accessed the application, so what can we do for this – Tarandeep Singh May 23 '14 at 16:29
  • for this you can start your activity with lock pattern using intent and your activity will infront of opened app. for that you should do some research work on start activity from service. – kiran boghra May 23 '14 at 18:25