Skip to content

Instantly share code, notes, and snippets.

@azec-pdx
Created February 8, 2015 14:52
Show Gist options
  • Select an option

  • Save azec-pdx/59c772ce661066fd79e3 to your computer and use it in GitHub Desktop.

Select an option

Save azec-pdx/59c772ce661066fd79e3 to your computer and use it in GitHub Desktop.
WakelockApplication primjer, layout
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >
<Button
android:id="@+id/buttonStart"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="@+id/buttonStop"
android:layout_below="@+id/buttonStop"
android:layout_marginTop="108dp"
android:onClick="releaseWakelock"
android:text="Wake Lock OFF" />
<Button
android:id="@+id/buttonStop"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="49dp"
android:onClick="acquirewakeLock"
android:text="Wake Lock ON" />
</RelativeLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment