Android开发中The type SmsManager is deprecated
2013-12-13 16:28
239 查看
import android.telephony.SmsMessage;
@Override public void onClick(View v) { // TODO Auto-generated method stub if(R.id.imageButton1 == v.getId()) { SmsManager mg = SmsManager.getDefault(); EditText et = (EditText)findViewById(R.id.editText1); String destinationAddress = et.getText().toString(); et = (EditText)findViewById(R.id.editText2); String text = et.getText().toString(); mg.sendTextMessage(destinationAddress, null, text, null, null); } }
在开发短信功能时,有可能提示SmsManager为deprecated
在某些版本里,Eclipse自动导包时会导入
import android.telephony.gsm.SmsManager;
事实上应该导入
import android.telephony.SmsManager;
即去掉中的gsm即可
相关文章推荐
- Android开发中The type SmsManager is deprecated提示
- Android开发: The type ClipboardManager is deprecated
- Android开发: The type ClipboardManager is deprecated
- android开发:The method getSupportFragmentManager() is undefined for the type
- The type SmsMessage is deprecated
- The type SmsMessage is deprecated
- The type SmsMessage is deprecated
- 安卓 方向传感器The field Sensor.TYPE_ORIENTATION is deprecated use SensorManager.getOrientation()instead介绍
- The method showDialog(int) from the type Activity is deprecated-android旧版dialog不能用的问题
- 获取显示窗口警告 android The method getWidth() from the type Display is deprecated
- Android studio之NDK integration is deprecated in the current plugin解决办法
- setBackgroundDrawable提示:The method setBackgroundDrawable(Drawable) from the type View is deprecated
- Error: Flag android.useDeprecatedNdk is no longer supported and will be removed in the next version
- Andriod: The method getDrawable(int) from the type Resources is deprecated,一系列问题
- Struts注解开发问题2——The Result type [json] which is defined in the Result annotation on the class
- Android错误:方法setListAdapter(ArrayAdapter<String>) is undefined for the type String
- Warning:The `android.dexOptions.incremental` property is deprecated and it has no effect on the buil
- android点滴2:The method...in the type View is not...
- rcp(插件开发)The type XXX cannot be resolved. It is indirectly referenced from required .class files解决办法
- JAVA中 错误代码是 the public type must be defined in its own file 解决方法 android开发 java编程