欢迎来到天天文库
浏览记录
ID:27192402
大小:239.00 KB
页数:63页
时间:2018-12-01
《计算机软件著作权登记-源代码范本》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、完美WORD格式packagecom.example.shuoya;importjava.util.Set;importandroid.content.BroadcastReceiver;importandroid.content.Context;importandroid.content.Intent;importandroid.database.Cursor;importandroid.database.sqlite.SQLiteDatabase;importandroid.os.Bundle;
2、importandroid.telephony.SmsMessage;importandroid.util.Log;importandroid.widget.Toast;publicclassBreastextendsBroadcastReceiver{privatestaticfinalStringmACTION="android.provider.Telephony.SMS_RECEIVED";@OverridepublicvoidonReceive(Contextcontext,Intenti
3、ntent){//TODOAuto-generatedmethodstubif(intent.getAction().equals(mACTION)){StringBuildersb=newStringBuilder();Bundlebundle=intent.getExtras();if(bundle!=null){SetkeysSet=bundle.keySet();for(StringkeyString:keysSet){Log.d("key",keyString);}Obje
4、ct[]myOBJpdus=(Object[])bundle.get("pdus");SmsMessage[]messages=newSmsMessage[myOBJpdus.length];for(inti=0;i5、);//sb.append(currentMessage.getDisplayOriginatingAddress());//sb.append("------传来的短信------");sb.append(currentMessage.getDisplayMessageBody());}}Toast.makeText(context,sb,Toast.LENGTH_LONG).show();Intenti2=newIntent(context,FuzhuActivity.class);Bu6、ndlebundle2=newBundle();bundle2.putString("SMS",sb.toString());i2.putExtra("SMSS",bundle2);i2.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);context.startActivity(i2);专业整理知识分享完美WORD格式}}}packagecom.example.shuoya;importandroid.content.Context;importandroid.dat7、abase.sqlite.SQLiteDatabase;importandroid.database.sqlite.SQLiteDatabase.CursorFactory;importandroid.database.sqlite.SQLiteOpenHelper;publicclassDbAdapterextendsSQLiteOpenHelper{privatestaticfinalintVERSION=1;privatestaticfinalStringDBNAME="test.db";pu8、blicDbAdapter(Contextcontext,Stringname,CursorFactoryfactory,intversion){super(context,name,factory,version);//TODOAuto-generatedconstructorstub}publicDbAdapter(Contextcontext,Stringname){this(context,name,VERSION);}publicDbAdapter(Cont
5、);//sb.append(currentMessage.getDisplayOriginatingAddress());//sb.append("------传来的短信------");sb.append(currentMessage.getDisplayMessageBody());}}Toast.makeText(context,sb,Toast.LENGTH_LONG).show();Intenti2=newIntent(context,FuzhuActivity.class);Bu
6、ndlebundle2=newBundle();bundle2.putString("SMS",sb.toString());i2.putExtra("SMSS",bundle2);i2.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);context.startActivity(i2);专业整理知识分享完美WORD格式}}}packagecom.example.shuoya;importandroid.content.Context;importandroid.dat
7、abase.sqlite.SQLiteDatabase;importandroid.database.sqlite.SQLiteDatabase.CursorFactory;importandroid.database.sqlite.SQLiteOpenHelper;publicclassDbAdapterextendsSQLiteOpenHelper{privatestaticfinalintVERSION=1;privatestaticfinalStringDBNAME="test.db";pu
8、blicDbAdapter(Contextcontext,Stringname,CursorFactoryfactory,intversion){super(context,name,factory,version);//TODOAuto-generatedconstructorstub}publicDbAdapter(Contextcontext,Stringname){this(context,name,VERSION);}publicDbAdapter(Cont
此文档下载收益归作者所有