| Platform Version | API Level | VERSION_CODE | Notes |
| 2 | |||
| Android 1.0 | 1 |
public class hello extends Activity {
int currentapiVersion=1;
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO 自动生成的方法存根
super.onCreate(savedInstanceState);
setContentView(R.layout.hello);
currentapiVersion=android.os.Build.VERSION.SDK_INT;//获取安卓系统的版本号
}
//屏蔽home键
public void onAttachedToWindow() {
if( currentapiVersion<14)
{
this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD);
super.onAttachedToWindow();
}
}
}

3万+

被折叠的 条评论
为什么被折叠?



