Android开发学习笔记:Android很有用的代码片段
1:查看是否有存储卡插入 Stringstatus=Environment.getExternalStorageState(); if(status.equals(Enviroment.MEDIA_MOUNTED)){ 说明有SD卡插入 } 2:让某个Activity透明 OnCreate中不设Layout this.setTheme(R.style.Theme_Transparent); 以下是Theme_Transparent的定义(注意transparent_bg是一副透明的图片) 3:在屏幕元素中设置句柄 使用Activity.findViewById来取得屏幕上的元素的句柄.使用该句柄您可以设置或获取任何该对象外露的值. TextViewmsgTextView=(TextView)findViewById(R.id.msg); msgTextView.setText(R.string.push_me); 4:发送短信 Stringbody=”thisismmsdemo”; Intentmmsintent=newIntent(Intent...