开发者

How To setKeepScreenOn()

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜