background image

23

    sb.append(fd.getAbsoluteFile());     

24

        

25

        Intent   intent   =   new   Intent(Intent.ACTION_SENDTO,   Uri.fromParts(”mmsto”, 

number, null));     
26

        

27

    // Below extra datas are all optional.     

28

        intent.putExtra(Messaging.KEY_ACTION_SENDTO_MESSAGE_SUBJECT, 

subject);     
29

    intent.putExtra(Messaging.KEY_ACTION_SENDTO_MESSAGE_BODY, body);     

30

 

 

 

 

intent.putExtra(Messaging.KEY_ACTION_SENDTO_CONTENT_URI, 

sb.toString());     
31

        intent.putExtra(Messaging.KEY_ACTION_SENDTO_COMPOSE_MODE, 

composeMode);     
32

 

 

 

 

intent.putExtra(Messaging.KEY_ACTION_SENDTO_EXIT_ON_SENT, 

exitOnSent);     
33

        

34

    startActivity(intent);  

6、显示 toast

35 view plaincopy 
36 Toast.makeText(this._getApplicationContext(),

 

R.string._item, 

Toast.LENGTH_SHORT).show();   

7、发送 Mail

37 mime = “img/jpg”;    
38

               

39 shareIntent.setDataAndType(Uri.fromFile(fd), mime);    
40

   

41 shareIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(fd));    
42

   

43 shareIntent.putExtra(Intent.EXTRA_SUBJECT, subject);    
44

   

45 shareIntent.putExtra(Intent.EXTRA_TEXT, body);  

8、注册一个 BroadcastReceiver

46 registerReceiver(mMasterResetReciever,

 

new 

IntentFilter(”OMS.action.MASTERRESET”));    
47

   

48 private BroadcastReceiver mMasterResetReciever = new BroadcastReceiver()   
49 {    
50

        public void onReceive(Context context, Intent intent)   

                     找软件资料,就到一览软件文库

http://wk.yl1001.com/rj/