Hey Jeremy,
Thanks a lot for your suggestion. However I'm still a bit unsure:
- In DroidGap.java, there's already an onCreate method, but that one
is "public void" and what you posted uses "protected void". Can I just
add:
----
PowerManager pm = (PowerManager)
getSystemService(Context.POWER_SERVICE);
wl = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "DoNotDimScreen");
---
To this method? Because if I do, Eclipse still throws an error: "wl
can not be resolved"
- Also, what about the import stuff? Can I just copy that into the top
part of Droidgap.java
If it's possible, could you pastebin your working Droidgap.java?
Because the only thing I need to change in that file is to add that
specific function to enable the PARTIAL_WAKE_LOCK during the lifecycle
of my application. I think that would probably be the easiest way. :)
Thanks,
Louis
On 14 Mai, 17:40, Jeremy Wadsack <
jeremy.wads...@gmail.com> wrote:
> It sounds like you have a syntax error that's preventing javac/eclipse from
> parsing the code. Double check your semicolons, parentheses, braces, etc.
>
> Or... you're only pasting the part from the OnCreate in the snippet into
> your OnCreate, right? You're not putting the whole snippet into OnCreate, ar
> you? That would definitely fail.
>
> Your OnCreate method should look like this when you are done:
>
> 1. @Override
> 2. protected void onCreate(Bundle savedInstanceState) {
> 3.
> PowerManager pm = (PowerManager)
> getSystemService(Context.POWER_SERVICE);
> 4. wl = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,
> "DoNotDimScreen");
> 5. }
>
> --
> Jeremy Wadsack
>
>
>
> On Thu, May 13, 2010 at 3:15 PM, mobweb <
i...@mobweb.ch> wrote:
> > It's me again, pardon the spam, but I think I found the solution, yet
> > again don't know how to implement it:
>
> > The solution to my problem seems to be the "PARTIAL_WAKE_LOCK" flag
> > as described here:
>
> >
http://developer.android.com/reference/android/os/PowerManager.html#P...
>
> > I also found a snippet on how to implement it:
> >
http://www.androidsnippets.org/snippets/53/(it should be ok to
> > > > > >
phonegap+u...@googlegroups.com<
phonegap%2Bunsu...@googlegroups.com>
> > > > > > For more options, visit this group athttp://
> >
groups.google.com/group/phonegap?hl=en?hl=en
>
> > > > > > For more info on PhoneGap or to download the code go
> >
towww.phonegap.com
>
> > > > > --
> > > > > You received this message because you are subscribed to the Google
> > > > > Groups "phonegap" group.
> > > > > To post to this group, send email to
phon...@googlegroups.com
> > > > > To unsubscribe from this group, send email to
> > > > >
phonegap+u...@googlegroups.com<
phonegap%2Bunsu...@googlegroups.com>
> > > > > For more options, visit this group athttp://
> >
groups.google.com/group/phonegap?hl=en?hl=en
>
> > > > > For more info on PhoneGap or to download the code go
> >
towww.phonegap.com
>
> > > > --
> > > > You received this message because you are subscribed to the Google
> > > > Groups "phonegap" group.
> > > > To post to this group, send email to
phon...@googlegroups.com
> > > > To unsubscribe from this group, send email to
> > > >
phonegap+u...@googlegroups.com<
phonegap%2Bunsu...@googlegroups.com>
> > >
phonegap+u...@googlegroups.com<
phonegap%2Bunsu...@googlegroups.com>
> >
phonegap+u...@googlegroups.com<
phonegap%2Bunsu...@googlegroups.com>