-2

I have made a torch/Flashlight app on android studio (which is working perfectly fine), what i want is to open the flash light just by clicking the app button (without opening the app). can anyone upload the source code. Please be clear and thorough.

A.khan
  • 1

2 Answers2

1

you can use transparent theme for the MainActivity and when activity start, turn on flash light and finish the activity! and nothing was showed to user! you can use this link transparent theme to know how define transparent theme.

Community
  • 1
  • 1
faraz khonsari
  • 1,924
  • 1
  • 19
  • 27
0

I think it isn't possible to enable flashlight by only clicking the app icon because app icon always refers to an activity.

But you can make a widget. It's well described on: http://www.vogella.com/tutorials/AndroidWidgets/article.html

Karol Jurski
  • 180
  • 1
  • 10