tags:

views:

89

answers:

2

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

thanks patrick

+2  A: 

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

   View view = findViewById(R.id.my_view);
Mayra
A: 

You could also use android:keepScreenOn in your layout xml to have it set automatically when your layout is inflated. See http://developer.android.com/intl/zh-TW/reference/android/view/View.html#attr_android:keepScreenOn

Al