开发者

How To setKeepScreenOn()

开发者 https://www.devze.com 2022-12-19 20:47 出处:网络
How can I reference the Activity View from with开发者_如何学运维in the onCreate() method so I can use view.setKeepScreenOn().You can get a specific view defined in your xml file like:

How can I reference the Activity View from with开发者_如何学运维in the onCreate() method so I can use view.setKeepScreenOn().


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

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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号