We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I've tried a large variety of methods form other threads, and noticed the hate on WakeLocks, which judging from the way they seem to work is reasonable, but I have not been able to get flags to work, and all the android imports don't seem to do much other than add more errors.
Answers
@sparkyjohn===
something like that i think::
getActivity().getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
if I just through that line in, it throws an error:
@sparkyjohn===
of course, you have to make an import for that::
import android.view.WindowManager;
The errors windows tells me that "only a type can be imported. android.view.WindowManger resolves to a package. And since other stuff about functions and classes not existing. Thank you so much for your patience by the way.
@sparkyjohn===
Some kind of bug: It is NOT a package, this message is stupid; try to save && restart, who knows???
Now it's telling me that "The funcition 'getActvity()' does not exist"
@sparkyjohn===
yes,i know, another bug:: it does not exist but it works, as you are in a fragment...
I put it in the setup of the program, is that not what I was supposed to do? And as side note, how would one cancel the flag? Would it be getActivity().getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_OFF); ?
@sparkyjohn===
no, in order to remove use clearFlags() instead of addFlags() as for the other point i am not sure for Processing, it could be in setup() but also in onCreate() or in onCreateView(), you have to try...