方法 1: use PowerManager and WakeLockAndroidManifest.xml权限:
<uses-permission android:name="android.permission.WAKE_LOCK" />
程序中的代码:
PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
PowerManager.WakeLock mWakeLock = pm.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK, "My Tag");
// in onResume() call
mWakeLock.acquire();
...
// in onPause() call
mWakeLock.release();
方法 2: use the window flag FLAG_KEEP_SCREEN_ON把下面的代码加入到程序onCreate方法中:
@Override
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
// Set keep screen on
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
}
分享到:
相关推荐
Reprinted from Physics World. Kaiser.QM
EMC Bible First published 1992 Reprinted 1994 (four times) Second edition 1996 Reprinted 1996, 1997, 1999, 2000, 2001 Third edition 2001 Reprinted 2003, 2005 (twice)
Reprinted from Communication of the ACM, Vol. 27, No. 8, August 1984, pp. 761-763. Copyright © 1984, Association for Computing Machinery, Inc. Also appears in ACM Turing Award Lectures: The First ...
No doubt this is extremely important, and I am sure all these books will have to be reprinted to satisfy the demand. But what about the plumbing? The .NET universe, like other information technology...
Copyright Law, no part of this book may be reprinted, reproduced, transmitted, or uti- lized in any form by any electronic, mechanical, or other means, now known or hereafter invented, including ...
# Reprinted_Applied_Energy 复刻论文Applied Energy的论文A bi-layer optimization based temporal and spatial scheduling for large-scale electric vehicles,包含考虑电动汽车有序充放电的机组组合和最优潮流 ...
reprinted : For a GPU version of this project, please refer to: The purpose of this project is to accelerate the processing speed of convolution neural network with the help of FPGA, which shows great...
Copyright Law, no part of this book may be reprinted, reproduced, transmitted, or utilized in any form by any electronic, mechanical, or other means, now known or hereafter invented, including ...
No doubt this is extremely important, and I am sure all these books will have to be reprinted to satisfy the demand. But what about the plumbing? The .NET universe, like other information technology...
Reprinted material is quoted with permission, and sources are indicated. A wide variety of references are listed. Reasonable efforts have been made to publish reliable data and information, but the ...
Reprinted material is quoted with permission, and sources are indicated. A wide variety of references are listed. Reasonable efforts have been made to publish reliable data and information, but the...
# Reprinted_Applied_Energy 复刻论文Applied Energy的论文A bi-layer optimization based temporal and spatial scheduling for large-scale electric vehicles,包含考虑电动汽车有序充放电的机组组合和最优潮流 ...
Hence, the 1926 first edition remains in print, along with the 1965 second edition, edited by Ernest Gowers, and reprinted in 1983 and 1987. The 1996 third edition, re-titled as The New Fowler's ...
Reprinted with corrections fromThe Bell System Technical Journal, Vol. 27, pp. 379–423, 623–656, July, October, 1948.A Mathematical Theory of CommunicationBy C. E. SHANNONINTRODUCTIONT HE recent ...
Reprinted material is quoted with permission, and sources are indicated. A wide variety of references are listed. Reasonable efforts have been made to publish reliable data and information, but the ...
in the first book's preface, which is reprinted here (immediately follow ing) for convenience. The surprisingly enthusiastic response to the first book has resulted in this second effort. This book is...
Reprinted material is quoted with permission, and sources are indicated. A wide variety of references are listed. Reasonable efforts have been made to publish reliable data and information, but the ...
It will consist of reprinted lecture notes, edited at least to a satisfactory level of completeness and intelligibility, though not necessarily to the perfection which is expected of a book. In ...
No part of this publication may be reprinted, reproduced, transmitted, or utilized in any form or by any electronic, mechanical, or other means, now known or hereafter invented, including ...
如果是转载自其它站点的文章:添加自定义栏目:reprinted,值:原文章的链接地址。 ■ 密码保护的文章 默认有密码保护的文章,部分内容会显示出来。可以在文章编辑框下的摘要中随意输入一些内容即可。 ■ 下载...