bugzy
bugzy

Reputation: 7096

How To setKeepScreenOn()

How can I reference the Activity View from within the onCreate() method so I can use view.setKeepScreenOn().

Upvotes: 1

Views: 4895

Answers (2)

Al.
Al.

Reputation: 76

You could also use android:keepScreenOn in your layout xml to have it set automatically when your layout is inflated. See the docs.

Upvotes: 1

Cheryl Simon
Cheryl Simon

Reputation: 46844

You can get a specific view defined in your xml file like:

   View view = findViewById(R.id.my_view);

Upvotes: 3

Related Questions