Intent跳转页面大全

STM32驱动AD7779:双极性电源下8通道同步ADC的SPI配置与数据采集实战 本文详细介绍了在双极性电源供电下,使用STM32通过SPI接口驱动AD7779同步ADC芯片实现8通道高精度数据采集的实战经验。重点解析了电源设计、抗干扰处理、寄存器配置、SPI通信技巧及数据校准方法,帮助工程师解决工业测量中的同步采样与噪声控制难题。 阅读详情

现在开发中的功能需要直接跳转到拨号、联系人、短信界面等等,查找了很多资料,自己整理了一下。
1、跳转到拨号界面,代码如下:

1)直接拨打

  1. Intent intentPhone = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + phoneNumber));

    startActivity(intentPhone);

  2. 2)跳转到拨号界面
  3. Intent intent = newIntent(Intent.ACTION_DIAL,Uri.parse("tel:" + phoneNumber));

    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

    startActivity(intent);
  4.  
  5. 2、跳转到联系人页面,使用一下代码:

    1. Intent intentPhone = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + phoneNumber));
      startActivity(intentPhone);

     

     

    以下内容为转载:

     

    Android开发之Intent跳转到系统应用中的拨号界面、联系人界面、短信界面
      现在开发中的功能需要直接跳转到拨号、联系人、短信界面等等,查找了很多资料,自己整理了一下。

    //安装已经存在的apk

    String filePath="mnt/sdcard/abc.apk";

    Intent intent = new  Intent(Intent.ACTION_VIEW);

    intent.setDataAndType(Uri.parse("file://" + filePath),

            "application/vnd.Android.package-archive");

    startActivity(intent);//直接跳到安装页面,但是还要点击按钮确定安装,还是取消安装

    //卸载某应用

    String packageName="org.adw.launcher2"

    Uri packageUri = Uri.parse("package:"+packageName);//包名,指定该应用

    Intent uninstallIntent = new Intent(Intent.ACTION_DELETE, packageUri);

    startActivity(uninstallIntent);

     

    //查看某一应用程序的信息

     Uri uri=Uri.parse("package:"+packageName);//包名,指定该应用

    Intent intent=new Intent("android.settings.APPLICATION_DETAILS_SETTINGS", uri);

    startActivity(intent); 

    2.浏览网页某一具体网址

     Uri uri = Uri.parse("http://xxxxxxxxxxxxxxxxxxxxxxxx");  

     Intent intent   = new Intent(Intent.ACTION_VIEW,uri);

    //加下面这句话就是启动系统自带的浏览器打开上面的网址,  不加下面一句话,  如果你有多个浏览器,就会弹出让你选择某一浏览器, 然后改浏览器就会打开该网址...............

    intent.setClassName("com.android.browser", "com.android.browser.BrowserActivity"); 

     startActivity(intent);

    //系统  设置  界面

    Intent intent=new Intent();

     intent.setClassName("com.android.settings","com.android.settings.Settings");

    startActivity(intent); 

    //回到桌面吗

    Intent intent = new Intent(Intent.ACTION_MAIN);

    intent.addCategory(Intent.CATEGORY_HOME);

    startActivity(intent);

    //系统   拨号    界面

    Intent intent= new Intent(Intent.ACTION_DIAL);  

    intent.setClassName("com.android.contacts","com.android.contacts.DialtactsActivity");

    startActivity(intent);     

    //系统 通话记录  界面

    Intent intent =new Intent(); 

    intent.setAction("android.intent.action.CALL_BUTTON"); 

    startActivity(intent);

    //拨号

     Uri uri = Uri.parse("tel:xxxxxx");   

     Intent intent = new Intent(Intent.ACTION_DIAL, uri);      

     startActivity(intent); 

     

    //启动拨号界面,指定了类名  包名   是系统的拨号界面    DialtactsActivity

    Intent intent= new Intent("android.intent.action.DIAL");  

     intent.setClassName("com.android.contacts","com.android.contacts.DialtactsActivity");

    startActivity(intent); 

    //系统  联系人  界面    PeopleActivity

    Intent intent001 = new Intent();

    intent001.setClassName("com.android.contacts","com.android.contacts.activities.PeopleActivity");

    startActivity(intent001);  

    //系统  搜索   界面    SearchActivity

    Intent intent002=new Intent();

    intent002.setClassName("com.android.quicksearchbox", "com.android.quicksearchbox.SearchActivity");

    startActivity(intent002);

    //启动短信收件箱的界面,指定了包名,类名

     Intent intent4 = new Intent();

    intent4.setClassName("com.android.mms","com.android.mms.ui.ConversationList");

    startActivity(intent4);

     //启动联系人界面,不好

    Intent intent = new Intent();  

     intent.setAction(Intent.ACTION_PICK);  

     intent.setData(Contacts.People.CONTENT_URI);  

     startActivity(intent);

     

    插入联系人

    Intent intent=newIntent(Intent.ACTION_EDIT,Uri.parse("content://com.android.contacts/contacts/"+"1")); 
    startActivity(intent);

     

    到联系人列表界面

    Intent intent = new Intent(Intent.ACTION_INSERT_OR_EDIT); 
    intent.setType("vnd.android.cursor.item/person"); 
    intent.setType("vnd.android.cursor.item/contact"); 
    intent.setType("vnd.android.cursor.item/raw_contact"); 
    intent.putExtra(android.provider.ContactsContract.Intents.Insert.NAME, name); 
    intent.putExtra(android.provider.ContactsContract.Intents.Insert.COMPANY,company); 
    intent.putExtra(android.provider.ContactsContract.Intents.Insert.PHONE, tel); 
    intent.putExtra(android.provider.ContactsContract.Intents.Insert.PHONE_TYPE, 3);
    //启动短信收件箱的界面,指定了包名,类名
    Intent intent = new Intent();
    intent.setClassName("com.android.mms","com.android.mms.ui.ConversationList");
    startActivity(intent);
    //启动编辑短信的界面
    Intent intent = new Intent(Intent.ACTION_VIEW); 
    intent.setType("vnd.android-dir/mms-sms");  
     // intent.setData(Uri.parse("content://mms-sms/conversations/"));//此为号码
    startActivity(intent);

 

---------------------------------------------------------------

2---------------------------------------------------------------

---------------------------------------------------------------

现在开发中的功能需要直接跳转到拨号、联系人、短信界面等等,查找了很多资料,自己整理了一下。
 首先,我们先看拨号界面,代码如下:

  1.  Intent intent =new Intent();  
  2.  intent.setAction("android.intent.action.CALL_BUTTON");  
  3.  startActivity(intent);

和

  1. Uri uri = Uri.parse("tel:xxxxxx");   
  2. Intent intent = new Intent(Intent.ACTION_DIAL, uri);     
  3. startActivity(intent);  

两者都行   


但是如果是跳转到应用,使用一下代码:

  1. Intent intent= new Intent("android.intent.action.DIAL");   
  2. intent.setClassName("com.android.contacts","com.android.contacts.DialtactsActivity");

到通话记录界面:

  1. Intent intent=new Intent();  
  2. intent.setAction(Intent.ACTION_CALL_BUTTON);  
  3. startActivity(intent);  

到联系人界面:

  1. Intent intent = new Intent();   
  2. intent.setAction(Intent.ACTION_VIEW);   
  3. intent.setData(Contacts.People.CONTENT_URI);   
  4. startActivity(intent);

到应用:

  1. Intent intent= new Intent("com.android.contacts.action.LIST_STREQUENT");   
  2. intent.setClassName("com.android.contacts","com.android.contacts.DialtactsActivity");

调用联系人界面:

  1. Intent intent = new Intent();   
  2. intent.setAction(Intent.ACTION_PICK);   
  3. intent.setData(Contacts.People.CONTENT_URI);   
  4. startActivity(intent);   

插入联系人

  1. Intent intent=new Intent(Intent.ACTION_EDIT,Uri.parse("content://com.android.contacts/contacts/"+"1"));  
  2. startActivity(intent);  

到联系人列表界面   

  1. Intent intent = new Intent(Intent.ACTION_INSERT_OR_EDIT);  
  2. intent.setType("vnd.android.cursor.item/person");  
  3. intent.setType("vnd.android.cursor.item/contact");  
  4. intent.setType("vnd.android.cursor.item/raw_contact");  
  5. intent.putExtra(android.provider.ContactsContract.Intents.Insert.NAME, name);  
  6. intent.putExtra(android.provider.ContactsContract.Intents.Insert.COMPANY,company);  
  7. intent.putExtra(android.provider.ContactsContract.Intents.Insert.PHONE, tel);   
  8. intent.putExtra(android.provider.ContactsContract.Intents.Insert.PHONE_TYPE, 3);

复制代码

到短信界面:

  1. Intent intent = new Intent(Intent.ACTION_VIEW);  
  2. intent.setType("vnd.android-dir/mms-sms");  
  3. //intent.setData(Uri.parse("content://mms-sms/conversations/"));//此为号码  
  4. startActivity(intent);  

到应用:

  1. Intent intent = new Intent("android.intent.action.CONVERSATION");  
  2. startActivity(intent);  
    1.  

以下是在网上找到的其他方法:
1.从google搜索内容

  1. Intent intent = new Intent();   
  2. intent.setAction(Intent.ACTION_WEB_SEARCH);   
  3. intent.putExtra(SearchManager.QUERY,"searchString")   
  4. startActivity(intent);   

2.浏览网页

  1. Uri uri = Uri.parse("http://www.google.com");   
  2. Intent it   = new Intent(Intent.ACTION_VIEW,uri);   
  3. startActivity(it);

3.显示地图

  1. Uri uri = Uri.parse("geo:38.899533,-77.036476");   
  2. Intent it = new Intent(Intent.Action_VIEW,uri);   
  3. startActivity(it);   

4.路径规划

  1. Uri uri = Uri.parse("http://maps.google.com/maps?f=dsaddr=startLat%20startLng&daddr=endLat%20endLng&hl=en");   
  2. Intent it = new Intent(Intent.ACTION_VIEW,URI);   
  3. startActivity(it);  

5.拨打电话

  1. Uri uri = Uri.parse("tel:xxxxxx");   
  2. Intent it = new Intent(Intent.ACTION_DIAL, uri);     
  3. startActivity(it);  

和

  1. uri = Uri.parse("tel:"+number);    
  2. intent = new Intent(Intent.ACTION_CALL,uri);    
  3. startActivity(intent);  

其中不同自己试验一下就知道了。 
6.调用发短信的程序

  1. Intent it = new Intent(Intent.ACTION_VIEW);     
  2. it.putExtra("sms_body", "The SMS text");     
  3. it.setType("vnd.android-dir/mms-sms");     
  4. startActivity(it);

和

  1. uri = Uri.parse("smsto:"+要发送短信的对方的number);    
  2. intent = new Intent(Intent.ACTION_SENDTO,uri);    
  3. startActivity(intent);   

和

  1. mIntent = new Intent(Intent.ACTION_VIEW);    
  2. mIntent.putExtra("address", c.getString(c.getColumnIndex(column)));    
  3. mIntent.setType("vnd.android-dir/mms-sms");    
  4. startActivity(mIntent);   

7.发送短信

  1. Uri uri = Uri.parse("smsto:0800000123");     
  2. Intent it = new Intent(Intent.ACTION_SENDTO, uri);     
  3. it.putExtra("sms_body", "The SMS text");     
  4. startActivity(it);   
  5. String body="this is sms demo";   
  6. Intent mmsintent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts("smsto", number, null));   
  7. mmsintent.putExtra(Messaging.KEY_ACTION_SENDTO_MESSAGE_BODY, body);   
  8. mmsintent.putExtra(Messaging.KEY_ACTION_SENDTO_COMPOSE_MODE, true);   
  9. mmsintent.putExtra(Messaging.KEY_ACTION_SENDTO_EXIT_ON_SENT, true);   
  10. startActivity(mmsintent);<span style="font-family:Simsun;white-space: normal; background-color: rgb(255, 255, 255);"> </span>  

8.发送彩信

  1. Uri uri = Uri.parse("content://media/external/images/media/23");     
  2. Intent it = new Intent(Intent.ACTION_SEND);     
  3. it.putExtra("sms_body", "some text");     
  4. it.putExtra(Intent.EXTRA_STREAM, uri);     
  5. it.setType("image/png");     
  6. startActivity(it);   
  7. StringBuilder sb = new StringBuilder();   
  8. sb.append("file://");   
  9. sb.append(fd.getAbsoluteFile());   
  10. Intent intent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts("mmsto", number, null));   
  11. // Below extra datas are all optional.   
  12. intent.putExtra(Messaging.KEY_ACTION_SENDTO_MESSAGE_SUBJECT, subject);   
  13. intent.putExtra(Messaging.KEY_ACTION_SENDTO_MESSAGE_BODY, body);   
  14. intent.putExtra(Messaging.KEY_ACTION_SENDTO_CONTENT_URI, sb.toString());   
  15. intent.putExtra(Messaging.KEY_ACTION_SENDTO_COMPOSE_MODE, composeMode);   
  16. intent.putExtra(Messaging.KEY_ACTION_SENDTO_EXIT_ON_SENT, exitOnSent);   
  17. startActivity(intent);   

9.发送Email

  1. Uri uri = Uri.parse("mailto:xxx@abc.com");   
  2. Intent it = new Intent(Intent.ACTION_SENDTO, uri);   
  3. startActivity(it);   
  4. Intent it = new Intent(Intent.ACTION_SEND);     
  5. it.putExtra(Intent.EXTRA_EMAIL, "me@abc.com");     
  6. it.putExtra(Intent.EXTRA_TEXT, "The email body text");     
  7. it.setType("text/plain");     
  8. startActivity(Intent.createChooser(it, "Choose Email Client"));   
  9. Intent it=new Intent(Intent.ACTION_SEND);       
  10. String[] tos={"me@abc.com"};       
  11. String[] ccs={"you@abc.com"};       
  12. it.putExtra(Intent.EXTRA_EMAIL, tos);       
  13. it.putExtra(Intent.EXTRA_CC, ccs);       
  14. it.putExtra(Intent.EXTRA_TEXT, "The email body text");       
  15. it.putExtra(Intent.EXTRA_SUBJECT, "The email subject text");       
  16. it.setType("message/rfc822");       
  17. startActivity(Intent.createChooser(it, "Choose Email Client"));     
  18.  
  1. Intent it = new Intent(Intent.ACTION_SEND);     
  2. it.putExtra(Intent.EXTRA_SUBJECT, "The email subject text");     
  3. it.putExtra(Intent.EXTRA_STREAM, "file:///sdcard/mysong.mp3");     
  4. sendIntent.setType("audio/mp3");     
  5. startActivity(Intent.createChooser(it, "Choose Email Client"));   

10.播放多媒体   

  1. Intent it = new Intent(Intent.ACTION_VIEW);   
  2. Uri uri = Uri.parse("file:///sdcard/song.mp3");   
  3. it.setDataAndType(uri, "audio/mp3");   
  4. startActivity(it);   
  5. Uri uri = Uri.withAppendedPath(MediaStore.Audio.Media.INTERNAL_CONTENT_URI, "1");     
  6. Intent it = new Intent(Intent.ACTION_VIEW, uri);     
  7. startActivity(it);   

11.uninstall apk

  1. Uri uri = Uri.fromParts("package", strPackageName, null);     
  2. Intent it = new Intent(Intent.ACTION_DELETE, uri);     
  3. startActivity(it);  

12.install apk

  1. Uri installUri = Uri.fromParts("package", "xxx", null);   
  2. returnIt = new Intent(Intent.ACTION_PACKAGE_ADDED, installUri);  

13. 打开照相机

  1. <1>Intent i = new Intent(Intent.ACTION_CAMERA_BUTTON, null);   
  2.           this.sendBroadcast(i);    
  3. <2>long dateTaken = System.currentTimeMillis();   
  4.          String name = createName(dateTaken) + ".jpg";   
  5.          fileName = folder + name;   
  6.          ContentValues values = new ContentValues();   
  7.          values.put(Images.Media.TITLE, fileName);   
  8.          values.put("_data", fileName);   
  9.          values.put(Images.Media.PICASA_ID, fileName);   
  10.          values.put(Images.Media.DISPLAY_NAME, fileName);   
  11.          values.put(Images.Media.DESCRIPTION, fileName);   
  12.          values.put(Images.ImageColumns.BUCKET_DISPLAY_NAME, fileName);   
  13.          Uri photoUri = getContentResolver().insert(   
  14.          MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values);   
     
  1.          Intent inttPhoto = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);   
  2.          inttPhoto.putExtra(MediaStore.EXTRA_OUTPUT, photoUri);   
  3.          startActivityForResult(inttPhoto, 10);

14.从gallery选取图片

  1.         Intent i = new Intent();   
  2.         i.setType("image/*");   
  3.         i.setAction(Intent.ACTION_GET_CONTENT);   
  4.         startActivityForResult(i, 11);   

15. 打开录音机

  1. Intent mi = new Intent(Media.RECORD_SOUND_ACTION);   
  2. startActivity(mi);

16.显示应用详细列表

  1. Uri uri = Uri.parse("market://details?id=app_id");          
  2. Intent it = new Intent(Intent.ACTION_VIEW, uri);          
  3. startActivity(it);          
  4. //where app_id is the application ID, find the ID           
  5. //by clicking on your application on Market home           
  6. //page, and notice the ID from the address bar<span style="font-family:Simsun;white-space: normal; background-color: rgb(255, 255, 255);">    </span>

刚才找app id未果,结果发现用package name也可以 Uri uri = Uri.parse("market://details?id=<packagename>");
这个简单多了 

17寻找应用     

  1. Uri uri = Uri.parse("market://search?q=pname:pkg_name");          
  2. Intent it = new Intent(Intent.ACTION_VIEW, uri);          
  3. startActivity(it);   
  4. //where pkg_name is the full package path for an application<span style="font-family:Simsun;white-space: normal; background-color: rgb(255, 255, 255);">     </span>  

复制代码

18打开联系人列表

  1.          Intent i = new Intent();   
  2.          i.setAction(Intent.ACTION_GET_CONTENT);   
  3.          i.setType("vnd.android.cursor.item/phone");   
  4.          startActivityForResult(i, REQUEST_TEXT);
  1.          Uri uri = Uri.parse("content://contacts/people");   
  2.          Intent it = new Intent(Intent.ACTION_PICK, uri);   
  3.          startActivityForResult(it, REQUEST_TEXT);  

19 打开另一程序

  1. Intent i = new Intent();   
  2. ComponentName cn = new ComponentName("com.yellowbook.android2",   "com.yellowbook.android2.AndroidSearch");   
    i.setComponent(cn);    

i.setAction("android.intent.action.MAIN");   

  1. startActivityForResult(i, RESULT_OK);  

20 添加到短信收件箱

  1. ContentValues cv = new ContentValues();      
  2. cv.put("type", "1");   
  3. cv.put("address","短信地址");  
  4. cv.put("body", "短信内容");   
  5. getContentResolver().insert(Uri.parse("content://sms/inbox"), cv);

21 从sim卡或者联系人中查询

  1. Cursor cursor;  
  2. Uri uri;  
  3. if (type == 1) {  

Intent intent = new Intent();  

  1. intent.setData(Uri.parse("content://icc/adn"));  
  2. uri = intent.getData();  
  3. } else  
  4. uri = People.CONTENT_URI;  
  1. cursor = activity.getContentResolver().query(uri, null, null, null, null);  
  2. while (cursor.moveToNext()) {  
  3. int peopleId = cursor.getColumnIndex(People._ID);
  4. int nameId = cursor.getColumnIndex(People.NAME); 
  5. int phoneId = cursor.getColumnIndex(People.NUMBER);}

查看某个联系人,当然这里是ACTION_VIEW,如果为选择并返回action改为ACTION_PICK,当然处理intent时返回需要用到 startActivityforResult 
Uri personUri = ContentUris.withAppendedId(People.CONTENT_URI, ID);//最后的ID参数为联系人Provider中的数据库BaseID,即哪一行 
Intent intent = new Intent(); intent.setAction(Intent.ACTION_VIEW); intent.setData(personUri); startActivity(intent); 

22 删除

  1. uri = ContentUris.withAppendedId(People.CONTENT_URI, 联系人id);  
  2. int count = activity.getContentResolver().delete(uri, null, null

23 添加到联系人:

  1. ContentValues cv = new ContentValues();  
  2. ArrayList<ContentProviderOperation> operationList = new ArrayList<ContentProviderOperation>();  
  3. ContentProviderOperation.Builder builder = ContentProviderOperation.newInsert(RawContacts.CONTENT_URI);  

builder.withValues(cv);  

  1. operationList.add(builder.build());  
  2. builder = ContentProviderOperation.newInsert(Data.CONTENT_URI);  
  3. builder.withValueBackReference(StructuredName.RAW_CONTACT_ID, 0);  
  4. builder.withValue(Data.MIMETYPE, StructuredName.CONTENT_ITEM_TYPE);  
  5. builder.withValue(StructuredName.DISPLAY_NAME, "自定义联系人名");  
  6. operationList.add(builder.build());  
  7. builder = ContentProviderOperation.newInsert(Data.CONTENT_URI);  
  8. builder.withValueBackReference(Phone.RAW_CONTACT_ID, 0);  
  9. builder.withValue(Data.MIMETYPE, Phone.CONTENT_ITEM_TYPE);  
  10. builder.withValue(Phone.NUMBER, "联系人的phonenumber");  
  11. builder.withValue(Data.IS_PRIMARY, 1);  
  12. operationList.add(builder.build());  
  13. try {  
  14.           getContentResolver().applyBatch(ContactsContract.AUTHORITY, operationList);  
  15.        } catch (RemoteException e) {  
  16.            e.printStackTrace();  
  17.        } catch (OperationApplicationException e) {  
  18.          e.printStackTrace();  
  19.      }  

23 选择一个图片

  1. Intent intent = new Intent(Intent.ACTION_GET_CONTENT);   
  2. intent.addCategory(Intent.CATEGORY_OPENABLE);  
  3. intent.setType("image/*");  
  4. startActivityForResult(intent, 0);   

24 调用Android设备的照相机,并设置拍照后存放位置

  1. Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);  
  2. intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(new File(Environment .getExternalStorageDirectory().getAbsolutePath()+"/cwj", android123 + ".jpg"))); //存放位置为sdcard卡上cwj文件夹,文件名为android123.jpg格式  
  3. startActivityForResult(intent, 0);  

25 在market上搜索指定package name,比如搜索com.android123.cwj的写法如下

  1. Uri uri = Uri.parse("market://search?q=pname:com.android123.cwj");   
  2. Intent intent = new Intent(Intent.ACTION_VIEW, uri); startActivity(intent);

26获取文件信息,并使用相对应软件打开

  1. private void openFile(File f)    
  2. {    
  3.    Intent intent = new Intent();    
  4.    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);    
  5.    intent.setAction(android.content.Intent.ACTION_VIEW);    
  6.    String type = getMIMEType(f);    
  7.    intent.setDataAndType(Uri.fromFile(f), type);    
  8.    startActivity(intent);    
  9. }    
  1. private String getMIMEType(File f){    
  2.    String end = f  .getName() .substring(f.getName().lastIndexOf(".") + 1,f.getName().length()).toLowerCase();    
  1.   String type = "";    
  2.   if (end.equals("mp3") || end.equals("aac") || end.equals("aac")|| end.equals("amr") || end.equals("mpeg")|| end.equals("mp4"))    
  3.   {    
  4.      type = "audio";    
  5.   }
  6.   else if (end.equals("jpg") || end.equals("gif")|| end.equals("png") || end.equals("jpeg"))    
  7.   { 
  8.      type = "image";    
  9.    }
  10.   else    
  11.   {    
  12.      type = "*";    
  13.   }    
  14.      type += "/*";     

         return type;    

    1. } 

---------------------------------------------------------------

---------------------------------------------------------------

---------------------------------------------------------------

现在开发中的功能需要直接跳转到拨号、联系人、短信界面等等,查找了很多资料,自己整理了一下。
1、跳转到拨号界面,代码如下:

1)直接拨打

  1. Intent intentPhone = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + phoneNumber));

    startActivity(intentPhone);

  2. 2)跳转到拨号界面
  3. Intent intent = newIntent(Intent.ACTION_DIAL,Uri.parse("tel:" + phoneNumber));

    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

    startActivity(intent);
  4.  
  5. 2、跳转到联系人页面,使用一下代码:

    1. Intent intentPhone = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + phoneNumber));
      startActivity(intentPhone);

---------------------------------------------------------------

3---------------------------------------------------------------

---------------------------------------------------------------

现在开发中的功能需要直接跳转到拨号、联系人、短信界面等等,查找了很多资料,自己整理了一下。
         首先,我们先看拨号界面,代码如下:

  1. Intent intent =new Intent();  
  2.             intent.setAction("android.intent.action.CALL_BUTTON");  
  3.             startActivity(intent);

复制代码

和

  1. Uri uri = Uri.parse("tel:xxxxxx");   
  2. Intent intent = new Intent(Intent.ACTION_DIAL, uri);     
  3. startActivity(intent);  

复制代码

两者都行   
但是如果是跳转到应用,使用一下代码:

  1. Intent intent= new Intent("android.intent.action.DIAL");   
  2. intent.setClassName("com.android.contacts","com.android.contacts.DialtactsActivity");

复制代码

到通话记录界面:

  1. Intent intent=new Intent();  
  2. intent.setAction(Intent.ACTION_CALL_BUTTON);  
  3. startActivity(intent);  

复制代码

到联系人界面:

  1. Intent intent = new Intent();   
  2. intent.setAction(Intent.ACTION_VIEW);   
  3. intent.setData(Contacts.People.CONTENT_URI);   
  4. startActivity(intent);

复制代码

同理,到应用:

  1. Intent intent= new Intent("com.android.contacts.action.LIST_STREQUENT");   
  2. intent.setClassName("com.android.contacts","com.android.contacts.DialtactsActivity");

复制代码

调用联系人界面:

  1. Intent intent = new Intent();   
  2. intent.setAction(Intent.ACTION_PICK);   
  3. intent.setData(Contacts.People.CONTENT_URI);   
  4. startActivity(intent);   

复制代码

插入联系人

  1. Intent intent=new Intent(Intent.ACTION_EDIT,Uri.parse("content://com.android.contacts/contacts/"+"1"));  
  2. startActivity(intent);  

复制代码

到联系人列表界面   

  1. Intent intent = new Intent(Intent.ACTION_INSERT_OR_EDIT);  
  2.             intent.setType("vnd.android.cursor.item/person");  
  3.             intent.setType("vnd.android.cursor.item/contact");  
  4.             intent.setType("vnd.android.cursor.item/raw_contact");  
  5.             intent.putExtra(android.provider.ContactsContract.Intents.Insert.NAME, name);  
  6.             intent.putExtra(android.provider.ContactsContract.Intents.Insert.COMPANY,company);  
  7.             intent.putExtra(android.provider.ContactsContract.Intents.Insert.PHONE, tel);  
  8.             intent.putExtra(android.provider.ContactsContract.Intents.Insert.PHONE_TYPE, 3);

复制代码

到短信界面:

  1. Intent intent = new Intent(Intent.ACTION_VIEW);  
  2.                 intent.setType("vnd.android-dir/mms-sms");  
  3. //              intent.setData(Uri.parse("content://mms-sms/conversations/"));//此为号码  
  4.                 startActivity(intent);  

复制代码

到应用:

  1. Intent intent = new Intent("android.intent.action.CONVERSATION");  
  2. startActivity(intent);  

复制代码

以下是在网上找到的其他方法:


1.从google搜索内容

  1. Intent intent = new Intent();   
  2. intent.setAction(Intent.ACTION_WEB_SEARCH);   
  3. intent.putExtra(SearchManager.QUERY,"searchString")   
  4. startActivity(intent);   

复制代码

2.浏览网页

  1. Uri uri = Uri.parse("http://www.google.com");   
  2. Intent it   = new Intent(Intent.ACTION_VIEW,uri);   
  3. startActivity(it);

复制代码

3.显示地图

  1. Uri uri = Uri.parse("geo:38.899533,-77.036476");   
  2. Intent it = new Intent(Intent.Action_VIEW,uri);   
  3. startActivity(it);   

复制代码

4.路径规划

  1. Uri uri = Uri.parse("http://maps.google.com/maps?f=dsaddr=startLat%20startLng&daddr=endLat%20endLng&hl=en");   
  2. Intent it = new Intent(Intent.ACTION_VIEW,URI);   
  3. startActivity(it);  

复制代码

5.拨打电话

  1. Uri uri = Uri.parse("tel:xxxxxx");   
  2. Intent it = new Intent(Intent.ACTION_DIAL, uri);     
  3. startActivity(it);  

复制代码

和

  1. uri = Uri.parse("tel:"+number);    
  2.                 intent = new Intent(Intent.ACTION_CALL,uri);    
  3.                 startActivity(intent);  

复制代码

其中不同自己试验一下就知道了。 

6.调用发短信的程序

  1. Intent it = new Intent(Intent.ACTION_VIEW);     
  2. it.putExtra("sms_body", "The SMS text");     
  3. it.setType("vnd.android-dir/mms-sms");     
  4. startActivity(it);

复制代码

和

  1. uri = Uri.parse("smsto:"+要发送短信的对方的number);    
  2.                 intent = new Intent(Intent.ACTION_SENDTO,uri);    
  3.                 startActivity(intent);   

复制代码

和

  1. mIntent = new Intent(Intent.ACTION_VIEW);    
  2.         mIntent.putExtra("address", c.getString(c.getColumnIndex(column)));    
  3.         mIntent.setType("vnd.android-dir/mms-sms");    
  4.         startActivity(mIntent);   

复制代码

7.发送短信

  1. Uri uri = Uri.parse("smsto:0800000123");     
  2. Intent it = new Intent(Intent.ACTION_SENDTO, uri);     
  3. it.putExtra("sms_body", "The SMS text");     
  4. startActivity(it);   
  5. String body="this is sms demo";   
  6. Intent mmsintent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts("smsto", number, null));   
  7. mmsintent.putExtra(Messaging.KEY_ACTION_SENDTO_MESSAGE_BODY, body);   
  8. mmsintent.putExtra(Messaging.KEY_ACTION_SENDTO_COMPOSE_MODE, true);   
  9. mmsintent.putExtra(Messaging.KEY_ACTION_SENDTO_EXIT_ON_SENT, true);   
  10. startActivity(mmsintent);<span style="font-family:Simsun;white-space: normal; background-color: rgb(255, 255, 255);"> </span>  

复制代码

8.发送彩信

  1. Uri uri = Uri.parse("content://media/external/images/media/23");     
  2. Intent it = new Intent(Intent.ACTION_SEND);     
  3. it.putExtra("sms_body", "some text");     
  4. it.putExtra(Intent.EXTRA_STREAM, uri);     
  5. it.setType("image/png");     
  6. startActivity(it);   
  7. StringBuilder sb = new StringBuilder();   
  8. sb.append("file://");   
  9. sb.append(fd.getAbsoluteFile());   
  10. Intent intent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts("mmsto", number, null));   
  11. // Below extra datas are all optional.   
  12. intent.putExtra(Messaging.KEY_ACTION_SENDTO_MESSAGE_SUBJECT, subject);   
  13. intent.putExtra(Messaging.KEY_ACTION_SENDTO_MESSAGE_BODY, body);   
  14. intent.putExtra(Messaging.KEY_ACTION_SENDTO_CONTENT_URI, sb.toString());   
  15. intent.putExtra(Messaging.KEY_ACTION_SENDTO_COMPOSE_MODE, composeMode);   
  16. intent.putExtra(Messaging.KEY_ACTION_SENDTO_EXIT_ON_SENT, exitOnSent);   
  17. startActivity(intent);   

复制代码

9.发送Email

  1. Uri uri = Uri.parse("mailto:xxx@abc.com");   
  2. Intent it = new Intent(Intent.ACTION_SENDTO, uri);   
  3. startActivity(it);   
  4. Intent it = new Intent(Intent.ACTION_SEND);     
  5. it.putExtra(Intent.EXTRA_EMAIL, "me@abc.com");     
  6. it.putExtra(Intent.EXTRA_TEXT, "The email body text");     
  7. it.setType("text/plain");     
  8. startActivity(Intent.createChooser(it, "Choose Email Client"));   
  9. Intent it=new Intent(Intent.ACTION_SEND);       
  10. String[] tos={"me@abc.com"};       
  11. String[] ccs={"you@abc.com"};       
  12. it.putExtra(Intent.EXTRA_EMAIL, tos);       
  13. it.putExtra(Intent.EXTRA_CC, ccs);       
  14. it.putExtra(Intent.EXTRA_TEXT, "The email body text");       
  15. it.putExtra(Intent.EXTRA_SUBJECT, "The email subject text");       
  16. it.setType("message/rfc822");       
  17. startActivity(Intent.createChooser(it, "Choose Email Client"));     
  18.   
  19. Intent it = new Intent(Intent.ACTION_SEND);     
  20. it.putExtra(Intent.EXTRA_SUBJECT, "The email subject text");     
  21. it.putExtra(Intent.EXTRA_STREAM, "file:///sdcard/mysong.mp3");     
  22. sendIntent.setType("audio/mp3");     
  23. startActivity(Intent.createChooser(it, "Choose Email Client"));   

复制代码

10.播放多媒体   

  1. Intent it = new Intent(Intent.ACTION_VIEW);   
  2. Uri uri = Uri.parse("file:///sdcard/song.mp3");   
  3. it.setDataAndType(uri, "audio/mp3");   
  4. startActivity(it);   
  5. Uri uri = Uri.withAppendedPath(MediaStore.Audio.Media.INTERNAL_CONTENT_URI, "1");     
  6. Intent it = new Intent(Intent.ACTION_VIEW, uri);     
  7. startActivity(it);   

复制代码

11.uninstall apk

  1. Uri uri = Uri.fromParts("package", strPackageName, null);     
  2. Intent it = new Intent(Intent.ACTION_DELETE, uri);     
  3. startActivity(it);  

复制代码

12.install apk

  1. Uri installUri = Uri.fromParts("package", "xxx", null);   
  2. returnIt = new Intent(Intent.ACTION_PACKAGE_ADDED, installUri);  

复制代码

13. 打开照相机

  1. <1>Intent i = new Intent(Intent.ACTION_CAMERA_BUTTON, null);   
  2.           this.sendBroadcast(i);   
  3.     <2>long dateTaken = System.currentTimeMillis();   
  4.          String name = createName(dateTaken) + ".jpg";   
  5.          fileName = folder + name;   
  6.          ContentValues values = new ContentValues();   
  7.          values.put(Images.Media.TITLE, fileName);   
  8.          values.put("_data", fileName);   
  9.          values.put(Images.Media.PICASA_ID, fileName);   
  10.          values.put(Images.Media.DISPLAY_NAME, fileName);   
  11.          values.put(Images.Media.DESCRIPTION, fileName);   
  12.          values.put(Images.ImageColumns.BUCKET_DISPLAY_NAME, fileName);   
  13.          Uri photoUri = getContentResolver().insert(   
  14.                    MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values);   
  15.              
  16.          Intent inttPhoto = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);   
  17.          inttPhoto.putExtra(MediaStore.EXTRA_OUTPUT, photoUri);   
  18.          startActivityForResult(inttPhoto, 10);

复制代码

14.从gallery选取图片

  1. Intent i = new Intent();   
  2.         i.setType("image/*");   
  3.         i.setAction(Intent.ACTION_GET_CONTENT);   
  4.         startActivityForResult(i, 11);   

复制代码

15. 打开录音机

  1. Intent mi = new Intent(Media.RECORD_SOUND_ACTION);   
  2.          startActivity(mi);

复制代码

16.显示应用详细列表

  1. Uri uri = Uri.parse("market://details?id=app_id");          
  2. Intent it = new Intent(Intent.ACTION_VIEW, uri);          
  3. startActivity(it);          
  4. //where app_id is the application ID, find the ID           
  5. //by clicking on your application on Market home           
  6. //page, and notice the ID from the address bar<span style="font-family:Simsun;white-space: normal; background-color: rgb(255, 255, 255);">    </span>

复制代码

刚才找app id未果,结果发现用package name也可以 Uri uri = Uri.parse("market://details?id=<packagename>");
这个简单多了 

17寻找应用     

  1. Uri uri = Uri.parse("market://search?q=pname:pkg_name");          
  2. Intent it = new Intent(Intent.ACTION_VIEW, uri);          
  3. startActivity(it);   
  4. //where pkg_name is the full package path for an application<span style="font-family:Simsun;white-space: normal; background-color: rgb(255, 255, 255);">     </span>  

复制代码

18打开联系人列表

  1. Intent i = new Intent();   
  2.          i.setAction(Intent.ACTION_GET_CONTENT);   
  3.          i.setType("vnd.android.cursor.item/phone");   
  4.          startActivityForResult(i, REQUEST_TEXT);

复制代码

  1. Uri uri = Uri.parse("content://contacts/people");   
  2.          Intent it = new Intent(Intent.ACTION_PICK, uri);   
  3.          startActivityForResult(it, REQUEST_TEXT);  

复制代码

19 打开另一程序

  1. Intent i = new Intent();   
  2.          ComponentName cn = new ComponentName("com.yellowbook.android2",   
  3.                    "com.yellowbook.android2.AndroidSearch");   
  4.          i.setComponent(cn);   
  5.          i.setAction("android.intent.action.MAIN");   
  6.          startActivityForResult(i, RESULT_OK);  

复制代码

20 添加到短信收件箱

  1. ContentValues cv = new ContentValues();      
  2.                 cv.put("type", "1");   
  3. cv.put("address","短信地址");  
  4. cv.put("body", "短信内容");   
  5. getContentResolver().insert(Uri.parse("content://sms/inbox"), cv);

复制代码

21 从sim卡或者联系人中查询

  1. Cursor cursor;  
  2.         Uri uri;  
  3.         if (type == 1) {  
  4.             Intent intent = new Intent();  
  5.             intent.setData(Uri.parse("content://icc/adn"));  
  6.             uri = intent.getData();  
  7.         } else  
  8.             uri = People.CONTENT_URI;  
  9.   
  10.         cursor = activity.getContentResolver().query(uri, null, null, null, null);  
  11. while (cursor.moveToNext()) {  
  12. int peopleId = cursor.getColumnIndex(People._ID);
  13. int nameId = cursor.getColumnIndex(People.NAME); 
  14. int phoneId = cursor.getColumnIndex(People.NUMBER);}

复制代码

查看某个联系人,当然这里是ACTION_VIEW,如果为选择并返回action改为ACTION_PICK,当然处理intent时返回需要用到 startActivityforResult 
Uri personUri = ContentUris.withAppendedId(People.CONTENT_URI, ID);//最后的ID参数为联系人Provider中的数据库BaseID,即哪一行 
Intent intent = new Intent(); intent.setAction(Intent.ACTION_VIEW); intent.setData(personUri); startActivity(intent); 


 

22 删除

  1. uri = ContentUris.withAppendedId(People.CONTENT_URI, 联系人id);  
  2.         int count = activity.getContentResolver().delete(uri, null, null

复制代码

23 添加到联系人:

  1. ContentValues cv = new ContentValues();  
  2.                     ArrayList<ContentProviderOperation> operationList = new ArrayList<ContentProviderOperation>();  
  3.                     ContentProviderOperation.Builder builder = ContentProviderOperation.newInsert(RawContacts.CONTENT_URI);  
  4.                     builder.withValues(cv);  
  5.                     operationList.add(builder.build());  
  6.                     builder = ContentProviderOperation.newInsert(Data.CONTENT_URI);  
  7.                     builder.withValueBackReference(StructuredName.RAW_CONTACT_ID, 0);  
  8.                     builder.withValue(Data.MIMETYPE, StructuredName.CONTENT_ITEM_TYPE);  
  9.                     builder.withValue(StructuredName.DISPLAY_NAME, "自定义联系人名");  
  10.                     operationList.add(builder.build());  
  11.                     builder = ContentProviderOperation.newInsert(Data.CONTENT_URI);  
  12.                     builder.withValueBackReference(Phone.RAW_CONTACT_ID, 0);  
  13.                     builder.withValue(Data.MIMETYPE, Phone.CONTENT_ITEM_TYPE);  
  14.                     builder.withValue(Phone.NUMBER, "联系人的phonenumber");  
  15.                     builder.withValue(Data.IS_PRIMARY, 1);  
  16.                     operationList.add(builder.build());  
  17.                     try {  
  18.                         getContentResolver().applyBatch(ContactsContract.AUTHORITY, operationList);  
  19.                     } catch (RemoteException e) {  
  20.                         e.printStackTrace();  
  21.                     } catch (OperationApplicationException e) {  
  22.                         e.printStackTrace();  
  23.                     }  

复制代码

23 选择一个图片

  1. Intent intent = new Intent(Intent.ACTION_GET_CONTENT);   
  2. intent.addCategory(Intent.CATEGORY_OPENABLE);  
  3. intent.setType("image/*");  
  4. startActivityForResult(intent, 0);   

复制代码

24 调用

Android

设备的照相机,并设置拍照后存放位置

  1. Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);  
  2. intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(new File(Environment .getExternalStorageDirectory().getAbsolutePath()+"/cwj", android123 + ".jpg"))); //存放位置为sdcard卡上cwj文件夹,文件名为android123.jpg格式  
  3. startActivityForResult(intent, 0);  

复制代码

25 在market上搜索指定package name,比如搜索com.android123.cwj的写法如下

  1. Uri uri = Uri.parse("market://search?q=pname:com.android123.cwj");  
  2. Intent intent = new Intent(Intent.ACTION_VIEW, uri); startActivity(intent);

复制代码

26获取文件信息,并使用相对应软件打开

  1. private void openFile(File f)    
  2. {    
  3.    Intent intent = new Intent();    
  4.    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);    
  5.    intent.setAction(android.content.Intent.ACTION_VIEW);    
  6.    String type = getMIMEType(f);    
  7.    intent.setDataAndType(Uri.fromFile(f), type);    
  8.    startActivity(intent);    
  9. }    
  10.    
  11. private String getMIMEType(File f){    
  12.    String end = f    
  13.        .getName()    
  14.        .substring(f.getName().lastIndexOf(".") + 1,    
  15.            f.getName().length()).toLowerCase();    
  16.    String type = "";    
  17.    if (end.equals("mp3") || end.equals("aac") || end.equals("aac")    
  18.        || end.equals("amr") || end.equals("mpeg")    
  19.        || end.equals("mp4"))    
  20.    {    
  21.      type = "audio";    
  22.    } else if (end.equals("jpg") || end.equals("gif")    
  23.        || end.equals("png") || end.equals("jpeg"))    
  24.    {    
  25.      type = "image";    
  26.    } else    
  27.    {    
  28.      type = "*";    
  29.    }    
  30.    type += "/*";    
  31.    return type;    

    现在开发中的功能需要直接跳转到拨号、联系人、短信界面等等,查找了很多资料,自己整理了一下。
    1、跳转到拨号界面,代码如下:

    1)直接拨打

  32. Intent intentPhone = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + phoneNumber));

    startActivity(intentPhone);

  33. 2)跳转到拨号界面
  34. Intent intent = newIntent(Intent.ACTION_DIAL,Uri.parse("tel:" + phoneNumber));

    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

    startActivity(intent);
  35.  
  36. 2、跳转到联系人页面,使用一下代码:

    1. Intent intentPhone = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + phoneNumber));
      startActivity(intentPhone);

     

     

    以下内容为转载:

     

    Android开发之Intent跳转到系统应用中的拨号界面、联系人界面、短信界面
      现在开发中的功能需要直接跳转到拨号、联系人、短信界面等等,查找了很多资料,自己整理了一下。

    //安装已经存在的apk

    String filePath="mnt/sdcard/abc.apk";

    Intent intent = new  Intent(Intent.ACTION_VIEW);

    intent.setDataAndType(Uri.parse("file://" + filePath),

            "application/vnd.Android.package-archive");

    startActivity(intent);//直接跳到安装页面,但是还要点击按钮确定安装,还是取消安装

    //卸载某应用

    String packageName="org.adw.launcher2"

    Uri packageUri = Uri.parse("package:"+packageName);//包名,指定该应用

    Intent uninstallIntent = new Intent(Intent.ACTION_DELETE, packageUri);

    startActivity(uninstallIntent);

     

    //查看某一应用程序的信息

     Uri uri=Uri.parse("package:"+packageName);//包名,指定该应用

    Intent intent=new Intent("android.settings.APPLICATION_DETAILS_SETTINGS", uri);

    startActivity(intent); 

    2.浏览网页某一具体网址

     Uri uri = Uri.parse("http://xxxxxxxxxxxxxxxxxxxxxxxx");  

     Intent intent   = new Intent(Intent.ACTION_VIEW,uri);

    //加下面这句话就是启动系统自带的浏览器打开上面的网址,  不加下面一句话,  如果你有多个浏览器,就会弹出让你选择某一浏览器, 然后改浏览器就会打开该网址...............

    intent.setClassName("com.android.browser", "com.android.browser.BrowserActivity"); 

     startActivity(intent);

    //系统  设置  界面

    Intent intent=new Intent();

     intent.setClassName("com.android.settings","com.android.settings.Settings");

    startActivity(intent); 

    //回到桌面吗

    Intent intent = new Intent(Intent.ACTION_MAIN);

    intent.addCategory(Intent.CATEGORY_HOME);

    startActivity(intent);

    //系统   拨号    界面

    Intent intent= new Intent(Intent.ACTION_DIAL);  

    intent.setClassName("com.android.contacts","com.android.contacts.DialtactsActivity");

    startActivity(intent);     

    //系统 通话记录  界面

    Intent intent =new Intent(); 

    intent.setAction("android.intent.action.CALL_BUTTON"); 

    startActivity(intent);

    //拨号

     Uri uri = Uri.parse("tel:xxxxxx");   

     Intent intent = new Intent(Intent.ACTION_DIAL, uri);      

     startActivity(intent); 

     

    //启动拨号界面,指定了类名  包名   是系统的拨号界面    DialtactsActivity

    Intent intent= new Intent("android.intent.action.DIAL");  

     intent.setClassName("com.android.contacts","com.android.contacts.DialtactsActivity");

    startActivity(intent); 

    //系统  联系人  界面    PeopleActivity

    Intent intent001 = new Intent();

    intent001.setClassName("com.android.contacts","com.android.contacts.activities.PeopleActivity");

    startActivity(intent001);  

    //系统  搜索   界面    SearchActivity

    Intent intent002=new Intent();

    intent002.setClassName("com.android.quicksearchbox", "com.android.quicksearchbox.SearchActivity");

    startActivity(intent002);

    //启动短信收件箱的界面,指定了包名,类名

     Intent intent4 = new Intent();

    intent4.setClassName("com.android.mms","com.android.mms.ui.ConversationList");

    startActivity(intent4);

     //启动联系人界面,不好

    Intent intent = new Intent();  

     intent.setAction(Intent.ACTION_PICK);  

     intent.setData(Contacts.People.CONTENT_URI);  

     startActivity(intent);

     

    插入联系人

    Intent intent=newIntent(Intent.ACTION_EDIT,Uri.parse("content://com.android.contacts/contacts/"+"1")); 
    startActivity(intent);

     

    到联系人列表界面

    Intent intent = new Intent(Intent.ACTION_INSERT_OR_EDIT); 
    intent.setType("vnd.android.cursor.item/person"); 
    intent.setType("vnd.android.cursor.item/contact"); 
    intent.setType("vnd.android.cursor.item/raw_contact"); 
    intent.putExtra(android.provider.ContactsContract.Intents.Insert.NAME, name); 
    intent.putExtra(android.provider.ContactsContract.Intents.Insert.COMPANY,company); 
    intent.putExtra(android.provider.ContactsContract.Intents.Insert.PHONE, tel); 
    intent.putExtra(android.provider.ContactsContract.Intents.Insert.PHONE_TYPE, 3);
    //启动短信收件箱的界面,指定了包名,类名
    Intent intent = new Intent();
    intent.setClassName("com.android.mms","com.android.mms.ui.ConversationList");
    startActivity(intent);
    //启动编辑短信的界面
    Intent intent = new Intent(Intent.ACTION_VIEW); 
    intent.setType("vnd.android-dir/mms-sms");  
     // intent.setData(Uri.parse("content://mms-sms/conversations/"));//此为号码
    startActivity(intent);
  37.  

    ---------------------------------------------------------------

    2---------------------------------------------------------------

    ---------------------------------------------------------------

    现在开发中的功能需要直接跳转到拨号、联系人、短信界面等等,查找了很多资料,自己整理了一下。
     首先,我们先看拨号界面,代码如下:

  38.  Intent intent =new Intent();  
  39.  intent.setAction("android.intent.action.CALL_BUTTON");  
  40.  startActivity(intent);
  41. 和

  42. Uri uri = Uri.parse("tel:xxxxxx");   
  43. Intent intent = new Intent(Intent.ACTION_DIAL, uri);     
  44. startActivity(intent);  
  45. 两者都行   


    但是如果是跳转到应用,使用一下代码:

  46. Intent intent= new Intent("android.intent.action.DIAL");   
  47. intent.setClassName("com.android.contacts","com.android.contacts.DialtactsActivity");
  48. 到通话记录界面:

  49. Intent intent=new Intent();  
  50. intent.setAction(Intent.ACTION_CALL_BUTTON);  
  51. startActivity(intent);  
  52. 到联系人界面:

  53. Intent intent = new Intent();   
  54. intent.setAction(Intent.ACTION_VIEW);   
  55. intent.setData(Contacts.People.CONTENT_URI);   
  56. startActivity(intent);
  57. 到应用:

  58. Intent intent= new Intent("com.android.contacts.action.LIST_STREQUENT");   
  59. intent.setClassName("com.android.contacts","com.android.contacts.DialtactsActivity");
  60. 调用联系人界面:

  61. Intent intent = new Intent();   
  62. intent.setAction(Intent.ACTION_PICK);   
  63. intent.setData(Contacts.People.CONTENT_URI);   
  64. startActivity(intent);   
  65. 插入联系人

  66. Intent intent=new Intent(Intent.ACTION_EDIT,Uri.parse("content://com.android.contacts/contacts/"+"1"));  
  67. startActivity(intent);  
  68. 到联系人列表界面   

  69. Intent intent = new Intent(Intent.ACTION_INSERT_OR_EDIT);  
  70. intent.setType("vnd.android.cursor.item/person");  
  71. intent.setType("vnd.android.cursor.item/contact");  
  72. intent.setType("vnd.android.cursor.item/raw_contact");  
  73. intent.putExtra(android.provider.ContactsContract.Intents.Insert.NAME, name);  
  74. intent.putExtra(android.provider.ContactsContract.Intents.Insert.COMPANY,company);  
  75. intent.putExtra(android.provider.ContactsContract.Intents.Insert.PHONE, tel);   
  76. intent.putExtra(android.provider.ContactsContract.Intents.Insert.PHONE_TYPE, 3);
  77. 复制代码

    到短信界面:

  78. Intent intent = new Intent(Intent.ACTION_VIEW);  
  79. intent.setType("vnd.android-dir/mms-sms");  
  80. //intent.setData(Uri.parse("content://mms-sms/conversations/"));//此为号码  
  81. startActivity(intent);  
  82. 到应用:

  83. Intent intent = new Intent("android.intent.action.CONVERSATION");  
  84. startActivity(intent);  
    1.  
  85. 以下是在网上找到的其他方法:
    1.从google搜索内容

  86. Intent intent = new Intent();   
  87. intent.setAction(Intent.ACTION_WEB_SEARCH);   
  88. intent.putExtra(SearchManager.QUERY,"searchString")   
  89. startActivity(intent);   
  90. 2.浏览网页

  91. Uri uri = Uri.parse("http://www.google.com");   
  92. Intent it   = new Intent(Intent.ACTION_VIEW,uri);   
  93. startActivity(it);
  94. 3.显示地图

  95. Uri uri = Uri.parse("geo:38.899533,-77.036476");   
  96. Intent it = new Intent(Intent.Action_VIEW,uri);   
  97. startActivity(it);   
  98. 4.路径规划

  99. Uri uri = Uri.parse("http://maps.google.com/maps?f=dsaddr=startLat%20startLng&daddr=endLat%20endLng&hl=en");   
  100. Intent it = new Intent(Intent.ACTION_VIEW,URI);   
  101. startActivity(it);  
  102. 5.拨打电话

  103. Uri uri = Uri.parse("tel:xxxxxx");   
  104. Intent it = new Intent(Intent.ACTION_DIAL, uri);     
  105. startActivity(it);  
  106. 和

  107. uri = Uri.parse("tel:"+number);    
  108. intent = new Intent(Intent.ACTION_CALL,uri);    
  109. startActivity(intent);  
  110. 其中不同自己试验一下就知道了。 
    6.调用发短信的程序

  111. Intent it = new Intent(Intent.ACTION_VIEW);     
  112. it.putExtra("sms_body", "The SMS text");     
  113. it.setType("vnd.android-dir/mms-sms");     
  114. startActivity(it);
  115. 和

  116. uri = Uri.parse("smsto:"+要发送短信的对方的number);    
  117. intent = new Intent(Intent.ACTION_SENDTO,uri);    
  118. startActivity(intent);   
  119. 和

  120. mIntent = new Intent(Intent.ACTION_VIEW);    
  121. mIntent.putExtra("address", c.getString(c.getColumnIndex(column)));    
  122. mIntent.setType("vnd.android-dir/mms-sms");    
  123. startActivity(mIntent);   
  124. 7.发送短信

  125. Uri uri = Uri.parse("smsto:0800000123");     
  126. Intent it = new Intent(Intent.ACTION_SENDTO, uri);     
  127. it.putExtra("sms_body", "The SMS text");     
  128. startActivity(it);   
  129. String body="this is sms demo";   
  130. Intent mmsintent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts("smsto", number, null));   
  131. mmsintent.putExtra(Messaging.KEY_ACTION_SENDTO_MESSAGE_BODY, body);   
  132. mmsintent.putExtra(Messaging.KEY_ACTION_SENDTO_COMPOSE_MODE, true);   
  133. mmsintent.putExtra(Messaging.KEY_ACTION_SENDTO_EXIT_ON_SENT, true);   
  134. startActivity(mmsintent);<span style="font-family:Simsun;white-space: normal; background-color: rgb(255, 255, 255);"> </span>  
  135. 8.发送彩信

  136. Uri uri = Uri.parse("content://media/external/images/media/23");     
  137. Intent it = new Intent(Intent.ACTION_SEND);     
  138. it.putExtra("sms_body", "some text");     
  139. it.putExtra(Intent.EXTRA_STREAM, uri);     
  140. it.setType("image/png");     
  141. startActivity(it);   
  142. StringBuilder sb = new StringBuilder();   
  143. sb.append("file://");   
  144. sb.append(fd.getAbsoluteFile());   
  145. Intent intent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts("mmsto", number, null));   
  146. // Below extra datas are all optional.   
  147. intent.putExtra(Messaging.KEY_ACTION_SENDTO_MESSAGE_SUBJECT, subject);   
  148. intent.putExtra(Messaging.KEY_ACTION_SENDTO_MESSAGE_BODY, body);   
  149. intent.putExtra(Messaging.KEY_ACTION_SENDTO_CONTENT_URI, sb.toString());   
  150. intent.putExtra(Messaging.KEY_ACTION_SENDTO_COMPOSE_MODE, composeMode);   
  151. intent.putExtra(Messaging.KEY_ACTION_SENDTO_EXIT_ON_SENT, exitOnSent);   
  152. startActivity(intent);   
  153. 9.发送Email

  154. Uri uri = Uri.parse("mailto:xxx@abc.com");   
  155. Intent it = new Intent(Intent.ACTION_SENDTO, uri);   
  156. startActivity(it);   
  157. Intent it = new Intent(Intent.ACTION_SEND);     
  158. it.putExtra(Intent.EXTRA_EMAIL, "me@abc.com");     
  159. it.putExtra(Intent.EXTRA_TEXT, "The email body text");     
  160. it.setType("text/plain");     
  161. startActivity(Intent.createChooser(it, "Choose Email Client"));   
  162. Intent it=new Intent(Intent.ACTION_SEND);       
  163. String[] tos={"me@abc.com"};       
  164. String[] ccs={"you@abc.com"};       
  165. it.putExtra(Intent.EXTRA_EMAIL, tos);       
  166. it.putExtra(Intent.EXTRA_CC, ccs);       
  167. it.putExtra(Intent.EXTRA_TEXT, "The email body text");       
  168. it.putExtra(Intent.EXTRA_SUBJECT, "The email subject text");       
  169. it.setType("message/rfc822");       
  170. startActivity(Intent.createChooser(it, "Choose Email Client"));     
  171.  
  172. Intent it = new Intent(Intent.ACTION_SEND);     
  173. it.putExtra(Intent.EXTRA_SUBJECT, "The email subject text");     
  174. it.putExtra(Intent.EXTRA_STREAM, "file:///sdcard/mysong.mp3");     
  175. sendIntent.setType("audio/mp3");     
  176. startActivity(Intent.createChooser(it, "Choose Email Client"));   
  177. 10.播放多媒体   

  178. Intent it = new Intent(Intent.ACTION_VIEW);   
  179. Uri uri = Uri.parse("file:///sdcard/song.mp3");   
  180. it.setDataAndType(uri, "audio/mp3");   
  181. startActivity(it);   
  182. Uri uri = Uri.withAppendedPath(MediaStore.Audio.Media.INTERNAL_CONTENT_URI, "1");     
  183. Intent it = new Intent(Intent.ACTION_VIEW, uri);     
  184. startActivity(it);   
  185. 11.uninstall apk

  186. Uri uri = Uri.fromParts("package", strPackageName, null);     
  187. Intent it = new Intent(Intent.ACTION_DELETE, uri);     
  188. startActivity(it);  
  189. 12.install apk

  190. Uri installUri = Uri.fromParts("package", "xxx", null);   
  191. returnIt = new Intent(Intent.ACTION_PACKAGE_ADDED, installUri);  
  192. 13. 打开照相机

  193. <1>Intent i = new Intent(Intent.ACTION_CAMERA_BUTTON, null);   
  194.           this.sendBroadcast(i);    
  195. <2>long dateTaken = System.currentTimeMillis();   
  196.          String name = createName(dateTaken) + ".jpg";   
  197.          fileName = folder + name;   
  198.          ContentValues values = new ContentValues();   
  199.          values.put(Images.Media.TITLE, fileName);   
  200.          values.put("_data", fileName);   
  201.          values.put(Images.Media.PICASA_ID, fileName);   
  202.          values.put(Images.Media.DISPLAY_NAME, fileName);   
  203.          values.put(Images.Media.DESCRIPTION, fileName);   
  204.          values.put(Images.ImageColumns.BUCKET_DISPLAY_NAME, fileName);   
  205.          Uri photoUri = getContentResolver().insert(   
  206.          MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values);   
     
  207.          Intent inttPhoto = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);   
  208.          inttPhoto.putExtra(MediaStore.EXTRA_OUTPUT, photoUri);   
  209.          startActivityForResult(inttPhoto, 10);
  210. 14.从gallery选取图片

  211.         Intent i = new Intent();   
  212.         i.setType("image/*");   
  213.         i.setAction(Intent.ACTION_GET_CONTENT);   
  214.         startActivityForResult(i, 11);   
  215. 15. 打开录音机

  216. Intent mi = new Intent(Media.RECORD_SOUND_ACTION);   
  217. startActivity(mi);
  218. 16.显示应用详细列表

  219. Uri uri = Uri.parse("market://details?id=app_id");          
  220. Intent it = new Intent(Intent.ACTION_VIEW, uri);          
  221. startActivity(it);          
  222. //where app_id is the application ID, find the ID           
  223. //by clicking on your application on Market home           
  224. //page, and notice the ID from the address bar<span style="font-family:Simsun;white-space: normal; background-color: rgb(255, 255, 255);">    </span>
  225. 刚才找app id未果,结果发现用package name也可以 Uri uri = Uri.parse("market://details?id=<packagename>");
    这个简单多了 

    17寻找应用     

  226. Uri uri = Uri.parse("market://search?q=pname:pkg_name");          
  227. Intent it = new Intent(Intent.ACTION_VIEW, uri);          
  228. startActivity(it);   
  229. //where pkg_name is the full package path for an application<span style="font-family:Simsun;white-space: normal; background-color: rgb(255, 255, 255);">     </span>  
  230. 复制代码

    18打开联系人列表

  231.          Intent i = new Intent();   
  232.          i.setAction(Intent.ACTION_GET_CONTENT);   
  233.          i.setType("vnd.android.cursor.item/phone");   
  234.          startActivityForResult(i, REQUEST_TEXT);
  235.          Uri uri = Uri.parse("content://contacts/people");   
  236.          Intent it = new Intent(Intent.ACTION_PICK, uri);   
  237.          startActivityForResult(it, REQUEST_TEXT);  
  238. 19 打开另一程序

  239. Intent i = new Intent();   
  240. ComponentName cn = new ComponentName("com.yellowbook.android2",   "com.yellowbook.android2.AndroidSearch");   
    i.setComponent(cn);    
  241. i.setAction("android.intent.action.MAIN");   

  242. startActivityForResult(i, RESULT_OK);  
  243. 20 添加到短信收件箱

  244. ContentValues cv = new ContentValues();      
  245. cv.put("type", "1");   
  246. cv.put("address","短信地址");  
  247. cv.put("body", "短信内容");   
  248. getContentResolver().insert(Uri.parse("content://sms/inbox"), cv);
  249. 21 从sim卡或者联系人中查询

  250. Cursor cursor;  
  251. Uri uri;  
  252. if (type == 1) {  
  253. Intent intent = new Intent();  

  254. intent.setData(Uri.parse("content://icc/adn"));  
  255. uri = intent.getData();  
  256. } else  
  257. uri = People.CONTENT_URI;  
  258. cursor = activity.getContentResolver().query(uri, null, null, null, null);  
  259. while (cursor.moveToNext()) {  
  260. int peopleId = cursor.getColumnIndex(People._ID);
  261. int nameId = cursor.getColumnIndex(People.NAME); 
  262. int phoneId = cursor.getColumnIndex(People.NUMBER);}
  263. 查看某个联系人,当然这里是ACTION_VIEW,如果为选择并返回action改为ACTION_PICK,当然处理intent时返回需要用到 startActivityforResult 
    Uri personUri = ContentUris.withAppendedId(People.CONTENT_URI, ID);//最后的ID参数为联系人Provider中的数据库BaseID,即哪一行 
    Intent intent = new Intent(); intent.setAction(Intent.ACTION_VIEW); intent.setData(personUri); startActivity(intent); 

    22 删除

  264. uri = ContentUris.withAppendedId(People.CONTENT_URI, 联系人id);  
  265. int count = activity.getContentResolver().delete(uri, null, null
  266. 23 添加到联系人:

  267. ContentValues cv = new ContentValues();  
  268. ArrayList<ContentProviderOperation> operationList = new ArrayList<ContentProviderOperation>();  
  269. ContentProviderOperation.Builder builder = ContentProviderOperation.newInsert(RawContacts.CONTENT_URI);  
  270. builder.withValues(cv);  

  271. operationList.add(builder.build());  
  272. builder = ContentProviderOperation.newInsert(Data.CONTENT_URI);  
  273. builder.withValueBackReference(StructuredName.RAW_CONTACT_ID, 0);  
  274. builder.withValue(Data.MIMETYPE, StructuredName.CONTENT_ITEM_TYPE);  
  275. builder.withValue(StructuredName.DISPLAY_NAME, "自定义联系人名");  
  276. operationList.add(builder.build());  
  277. builder = ContentProviderOperation.newInsert(Data.CONTENT_URI);  
  278. builder.withValueBackReference(Phone.RAW_CONTACT_ID, 0);  
  279. builder.withValue(Data.MIMETYPE, Phone.CONTENT_ITEM_TYPE);  
  280. builder.withValue(Phone.NUMBER, "联系人的phonenumber");  
  281. builder.withValue(Data.IS_PRIMARY, 1);  
  282. operationList.add(builder.build());  
  283. try {  
  284.           getContentResolver().applyBatch(ContactsContract.AUTHORITY, operationList);  
  285.        } catch (RemoteException e) {  
  286.            e.printStackTrace();  
  287.        } catch (OperationApplicationException e) {  
  288.          e.printStackTrace();  
  289.      }  
  290. 23 选择一个图片

  291. Intent intent = new Intent(Intent.ACTION_GET_CONTENT);   
  292. intent.addCategory(Intent.CATEGORY_OPENABLE);  
  293. intent.setType("image/*");  
  294. startActivityForResult(intent, 0);   
  295. 24 调用Android设备的照相机,并设置拍照后存放位置

  296. Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);  
  297. intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(new File(Environment .getExternalStorageDirectory().getAbsolutePath()+"/cwj", android123 + ".jpg"))); //存放位置为sdcard卡上cwj文件夹,文件名为android123.jpg格式  
  298. startActivityForResult(intent, 0);  
  299. 25 在market上搜索指定package name,比如搜索com.android123.cwj的写法如下

  300. Uri uri = Uri.parse("market://search?q=pname:com.android123.cwj");   
  301. Intent intent = new Intent(Intent.ACTION_VIEW, uri); startActivity(intent);
  302. 26获取文件信息,并使用相对应软件打开

  303. private void openFile(File f)    
  304. {    
  305.    Intent intent = new Intent();    
  306.    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);    
  307.    intent.setAction(android.content.Intent.ACTION_VIEW);    
  308.    String type = getMIMEType(f);    
  309.    intent.setDataAndType(Uri.fromFile(f), type);    
  310.    startActivity(intent);    
  311. }    
  312. private String getMIMEType(File f){    
  313.    String end = f  .getName() .substring(f.getName().lastIndexOf(".") + 1,f.getName().length()).toLowerCase();    
  314.   String type = "";    
  315.   if (end.equals("mp3") || end.equals("aac") || end.equals("aac")|| end.equals("amr") || end.equals("mpeg")|| end.equals("mp4"))    
  316.   {    
  317.      type = "audio";    
  318.   }
  319.   else if (end.equals("jpg") || end.equals("gif")|| end.equals("png") || end.equals("jpeg"))    
  320.   { 
  321.      type = "image";    
  322.    }
  323.   else    
  324.   {    
  325.      type = "*";    
  326.   }    
  327.      type += "/*";     

         return type;    

    1. } 
  328. ---------------------------------------------------------------

    ---------------------------------------------------------------

    ---------------------------------------------------------------

    现在开发中的功能需要直接跳转到拨号、联系人、短信界面等等,查找了很多资料,自己整理了一下。
    1、跳转到拨号界面,代码如下:

    1)直接拨打

  329. Intent intentPhone = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + phoneNumber));

    startActivity(intentPhone);

  330. 2)跳转到拨号界面
  331. Intent intent = newIntent(Intent.ACTION_DIAL,Uri.parse("tel:" + phoneNumber));

    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

    startActivity(intent);
  332.  
  333. 2、跳转到联系人页面,使用一下代码:

    1. Intent intentPhone = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + phoneNumber));
      startActivity(intentPhone);
  334. ---------------------------------------------------------------

    3---------------------------------------------------------------

    ---------------------------------------------------------------

    现在开发中的功能需要直接跳转到拨号、联系人、短信界面等等,查找了很多资料,自己整理了一下。
             首先,我们先看拨号界面,代码如下:
  335. Intent intent =new Intent();  
  336.             intent.setAction("android.intent.action.CALL_BUTTON");  
  337.             startActivity(intent);
  338. 复制代码

    和
  339. Uri uri = Uri.parse("tel:xxxxxx");   
  340. Intent intent = new Intent(Intent.ACTION_DIAL, uri);     
  341. startActivity(intent);  
  342. 复制代码

    两者都行   
    但是如果是跳转到应用,使用一下代码:
  343. Intent intent= new Intent("android.intent.action.DIAL");   
  344. intent.setClassName("com.android.contacts","com.android.contacts.DialtactsActivity");
  345. 复制代码

    到通话记录界面:
  346. Intent intent=new Intent();  
  347. intent.setAction(Intent.ACTION_CALL_BUTTON);  
  348. startActivity(intent);  
  349. 复制代码

    到联系人界面:
  350. Intent intent = new Intent();   
  351. intent.setAction(Intent.ACTION_VIEW);   
  352. intent.setData(Contacts.People.CONTENT_URI);   
  353. startActivity(intent);
  354. 复制代码

    同理,到应用:
  355. Intent intent= new Intent("com.android.contacts.action.LIST_STREQUENT");   
  356. intent.setClassName("com.android.contacts","com.android.contacts.DialtactsActivity");
  357. 复制代码

    调用联系人界面:
  358. Intent intent = new Intent();   
  359. intent.setAction(Intent.ACTION_PICK);   
  360. intent.setData(Contacts.People.CONTENT_URI);   
  361. startActivity(intent);   
  362. 复制代码

    插入联系人
  363. Intent intent=new Intent(Intent.ACTION_EDIT,Uri.parse("content://com.android.contacts/contacts/"+"1"));  
  364. startActivity(intent);  
  365. 复制代码

    到联系人列表界面   
  366. Intent intent = new Intent(Intent.ACTION_INSERT_OR_EDIT);  
  367.             intent.setType("vnd.android.cursor.item/person");  
  368.             intent.setType("vnd.android.cursor.item/contact");  
  369.             intent.setType("vnd.android.cursor.item/raw_contact");  
  370.             intent.putExtra(android.provider.ContactsContract.Intents.Insert.NAME, name);  
  371.             intent.putExtra(android.provider.ContactsContract.Intents.Insert.COMPANY,company);  
  372.             intent.putExtra(android.provider.ContactsContract.Intents.Insert.PHONE, tel);  
  373.             intent.putExtra(android.provider.ContactsContract.Intents.Insert.PHONE_TYPE, 3);
  374. 复制代码

    到短信界面:
  375. Intent intent = new Intent(Intent.ACTION_VIEW);  
  376.                 intent.setType("vnd.android-dir/mms-sms");  
  377. //              intent.setData(Uri.parse("content://mms-sms/conversations/"));//此为号码  
  378.                 startActivity(intent);  
  379. 复制代码

    到应用:
  380. Intent intent = new Intent("android.intent.action.CONVERSATION");  
  381. startActivity(intent);  
  382. 复制代码

    以下是在网上找到的其他方法:


    1.从google搜索内容
  383. Intent intent = new Intent();   
  384. intent.setAction(Intent.ACTION_WEB_SEARCH);   
  385. intent.putExtra(SearchManager.QUERY,"searchString")   
  386. startActivity(intent);   
  387. 复制代码

    2.浏览网页
  388. Uri uri = Uri.parse("http://www.google.com");   
  389. Intent it   = new Intent(Intent.ACTION_VIEW,uri);   
  390. startActivity(it);
  391. 复制代码

    3.显示地图
  392. Uri uri = Uri.parse("geo:38.899533,-77.036476");   
  393. Intent it = new Intent(Intent.Action_VIEW,uri);   
  394. startActivity(it);   
  395. 复制代码

    4.路径规划
  396. Uri uri = Uri.parse("http://maps.google.com/maps?f=dsaddr=startLat%20startLng&daddr=endLat%20endLng&hl=en");   
  397. Intent it = new Intent(Intent.ACTION_VIEW,URI);   
  398. startActivity(it);  
  399. 复制代码

    5.拨打电话
  400. Uri uri = Uri.parse("tel:xxxxxx");   
  401. Intent it = new Intent(Intent.ACTION_DIAL, uri);     
  402. startActivity(it);  
  403. 复制代码

    和
  404. uri = Uri.parse("tel:"+number);    
  405.                 intent = new Intent(Intent.ACTION_CALL,uri);    
  406.                 startActivity(intent);  
  407. 复制代码

    其中不同自己试验一下就知道了。 

    6.调用发短信的程序
  408. Intent it = new Intent(Intent.ACTION_VIEW);     
  409. it.putExtra("sms_body", "The SMS text");     
  410. it.setType("vnd.android-dir/mms-sms");     
  411. startActivity(it);
  412. 复制代码

    和
  413. uri = Uri.parse("smsto:"+要发送短信的对方的number);    
  414.                 intent = new Intent(Intent.ACTION_SENDTO,uri);    
  415.                 startActivity(intent);   
  416. 复制代码

    和
  417. mIntent = new Intent(Intent.ACTION_VIEW);    
  418.         mIntent.putExtra("address", c.getString(c.getColumnIndex(column)));    
  419.         mIntent.setType("vnd.android-dir/mms-sms");    
  420.         startActivity(mIntent);   
  421. 复制代码

    7.发送短信
  422. Uri uri = Uri.parse("smsto:0800000123");     
  423. Intent it = new Intent(Intent.ACTION_SENDTO, uri);     
  424. it.putExtra("sms_body", "The SMS text");     
  425. startActivity(it);   
  426. String body="this is sms demo";   
  427. Intent mmsintent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts("smsto", number, null));   
  428. mmsintent.putExtra(Messaging.KEY_ACTION_SENDTO_MESSAGE_BODY, body);   
  429. mmsintent.putExtra(Messaging.KEY_ACTION_SENDTO_COMPOSE_MODE, true);   
  430. mmsintent.putExtra(Messaging.KEY_ACTION_SENDTO_EXIT_ON_SENT, true);   
  431. startActivity(mmsintent);<span style="font-family:Simsun;white-space: normal; background-color: rgb(255, 255, 255);"> </span>  
  432. 复制代码

    8.发送彩信
  433. Uri uri = Uri.parse("content://media/external/images/media/23");     
  434. Intent it = new Intent(Intent.ACTION_SEND);     
  435. it.putExtra("sms_body", "some text");     
  436. it.putExtra(Intent.EXTRA_STREAM, uri);     
  437. it.setType("image/png");     
  438. startActivity(it);   
  439. StringBuilder sb = new StringBuilder();   
  440. sb.append("file://");   
  441. sb.append(fd.getAbsoluteFile());   
  442. Intent intent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts("mmsto", number, null));   
  443. // Below extra datas are all optional.   
  444. intent.putExtra(Messaging.KEY_ACTION_SENDTO_MESSAGE_SUBJECT, subject);   
  445. intent.putExtra(Messaging.KEY_ACTION_SENDTO_MESSAGE_BODY, body);   
  446. intent.putExtra(Messaging.KEY_ACTION_SENDTO_CONTENT_URI, sb.toString());   
  447. intent.putExtra(Messaging.KEY_ACTION_SENDTO_COMPOSE_MODE, composeMode);   
  448. intent.putExtra(Messaging.KEY_ACTION_SENDTO_EXIT_ON_SENT, exitOnSent);   
  449. startActivity(intent);   
  450. 复制代码

    9.发送Email
  451. Uri uri = Uri.parse("mailto:xxx@abc.com");   
  452. Intent it = new Intent(Intent.ACTION_SENDTO, uri);   
  453. startActivity(it);   
  454. Intent it = new Intent(Intent.ACTION_SEND);     
  455. it.putExtra(Intent.EXTRA_EMAIL, "me@abc.com");     
  456. it.putExtra(Intent.EXTRA_TEXT, "The email body text");     
  457. it.setType("text/plain");     
  458. startActivity(Intent.createChooser(it, "Choose Email Client"));   
  459. Intent it=new Intent(Intent.ACTION_SEND);       
  460. String[] tos={"me@abc.com"};       
  461. String[] ccs={"you@abc.com"};       
  462. it.putExtra(Intent.EXTRA_EMAIL, tos);       
  463. it.putExtra(Intent.EXTRA_CC, ccs);       
  464. it.putExtra(Intent.EXTRA_TEXT, "The email body text");       
  465. it.putExtra(Intent.EXTRA_SUBJECT, "The email subject text");       
  466. it.setType("message/rfc822");       
  467. startActivity(Intent.createChooser(it, "Choose Email Client"));     
  468.   
  469. Intent it = new Intent(Intent.ACTION_SEND);     
  470. it.putExtra(Intent.EXTRA_SUBJECT, "The email subject text");     
  471. it.putExtra(Intent.EXTRA_STREAM, "file:///sdcard/mysong.mp3");     
  472. sendIntent.setType("audio/mp3");     
  473. startActivity(Intent.createChooser(it, "Choose Email Client"));   
  474. 复制代码

    10.播放多媒体   
  475. Intent it = new Intent(Intent.ACTION_VIEW);   
  476. Uri uri = Uri.parse("file:///sdcard/song.mp3");   
  477. it.setDataAndType(uri, "audio/mp3");   
  478. startActivity(it);   
  479. Uri uri = Uri.withAppendedPath(MediaStore.Audio.Media.INTERNAL_CONTENT_URI, "1");     
  480. Intent it = new Intent(Intent.ACTION_VIEW, uri);     
  481. startActivity(it);   
  482. 复制代码

    11.uninstall apk
  483. Uri uri = Uri.fromParts("package", strPackageName, null);     
  484. Intent it = new Intent(Intent.ACTION_DELETE, uri);     
  485. startActivity(it);  
  486. 复制代码

    12.install apk
  487. Uri installUri = Uri.fromParts("package", "xxx", null);   
  488. returnIt = new Intent(Intent.ACTION_PACKAGE_ADDED, installUri);  
  489. 复制代码

    13. 打开照相机
  490. <1>Intent i = new Intent(Intent.ACTION_CAMERA_BUTTON, null);   
  491.           this.sendBroadcast(i);   
  492.     <2>long dateTaken = System.currentTimeMillis();   
  493.          String name = createName(dateTaken) + ".jpg";   
  494.          fileName = folder + name;   
  495.          ContentValues values = new ContentValues();   
  496.          values.put(Images.Media.TITLE, fileName);   
  497.          values.put("_data", fileName);   
  498.          values.put(Images.Media.PICASA_ID, fileName);   
  499.          values.put(Images.Media.DISPLAY_NAME, fileName);   
  500.          values.put(Images.Media.DESCRIPTION, fileName);   
  501.          values.put(Images.ImageColumns.BUCKET_DISPLAY_NAME, fileName);   
  502.          Uri photoUri = getContentResolver().insert(   
  503.                    MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values);   
  504.              
  505.          Intent inttPhoto = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);   
  506.          inttPhoto.putExtra(MediaStore.EXTRA_OUTPUT, photoUri);   
  507.          startActivityForResult(inttPhoto, 10);
  508. 复制代码

    14.从gallery选取图片
  509. Intent i = new Intent();   
  510.         i.setType("image/*");   
  511.         i.setAction(Intent.ACTION_GET_CONTENT);   
  512.         startActivityForResult(i, 11);   
  513. 复制代码

    15. 打开录音机
  514. Intent mi = new Intent(Media.RECORD_SOUND_ACTION);   
  515.          startActivity(mi);
  516. 复制代码

    16.显示应用详细列表
  517. Uri uri = Uri.parse("market://details?id=app_id");          
  518. Intent it = new Intent(Intent.ACTION_VIEW, uri);          
  519. startActivity(it);          
  520. //where app_id is the application ID, find the ID           
  521. //by clicking on your application on Market home           
  522. //page, and notice the ID from the address bar<span style="font-family:Simsun;white-space: normal; background-color: rgb(255, 255, 255);">    </span>
  523. 复制代码

    刚才找app id未果,结果发现用package name也可以 Uri uri = Uri.parse("market://details?id=<packagename>");
    这个简单多了 

    17寻找应用     
  524. Uri uri = Uri.parse("market://search?q=pname:pkg_name");          
  525. Intent it = new Intent(Intent.ACTION_VIEW, uri);          
  526. startActivity(it);   
  527. //where pkg_name is the full package path for an application<span style="font-family:Simsun;white-space: normal; background-color: rgb(255, 255, 255);">     </span>  
  528. 复制代码

    18打开联系人列表
  529. Intent i = new Intent();   
  530.          i.setAction(Intent.ACTION_GET_CONTENT);   
  531.          i.setType("vnd.android.cursor.item/phone");   
  532.          startActivityForResult(i, REQUEST_TEXT);
  533. 复制代码

  534. Uri uri = Uri.parse("content://contacts/people");   
  535.          Intent it = new Intent(Intent.ACTION_PICK, uri);   
  536.          startActivityForResult(it, REQUEST_TEXT);  
  537. 复制代码

    19 打开另一程序
  538. Intent i = new Intent();   
  539.          ComponentName cn = new ComponentName("com.yellowbook.android2",   
  540.                    "com.yellowbook.android2.AndroidSearch");   
  541.          i.setComponent(cn);   
  542.          i.setAction("android.intent.action.MAIN");   
  543.          startActivityForResult(i, RESULT_OK);  
  544. 复制代码

    20 添加到短信收件箱
  545. ContentValues cv = new ContentValues();      
  546.                 cv.put("type", "1");   
  547. cv.put("address","短信地址");  
  548. cv.put("body", "短信内容");   
  549. getContentResolver().insert(Uri.parse("content://sms/inbox"), cv);
  550. 复制代码

    21 从sim卡或者联系人中查询
  551. Cursor cursor;  
  552.         Uri uri;  
  553.         if (type == 1) {  
  554.             Intent intent = new Intent();  
  555.             intent.setData(Uri.parse("content://icc/adn"));  
  556.             uri = intent.getData();  
  557.         } else  
  558.             uri = People.CONTENT_URI;  
  559.   
  560.         cursor = activity.getContentResolver().query(uri, null, null, null, null);  
  561. while (cursor.moveToNext()) {  
  562. int peopleId = cursor.getColumnIndex(People._ID);
  563. int nameId = cursor.getColumnIndex(People.NAME); 
  564. int phoneId = cursor.getColumnIndex(People.NUMBER);}
  565. 复制代码

    查看某个联系人,当然这里是ACTION_VIEW,如果为选择并返回action改为ACTION_PICK,当然处理intent时返回需要用到 startActivityforResult 
    Uri personUri = ContentUris.withAppendedId(People.CONTENT_URI, ID);//最后的ID参数为联系人Provider中的数据库BaseID,即哪一行 
    Intent intent = new Intent(); intent.setAction(Intent.ACTION_VIEW); intent.setData(personUri); startActivity(intent); 


     

    22 删除

  566. uri = ContentUris.withAppendedId(People.CONTENT_URI, 联系人id);  
  567.         int count = activity.getContentResolver().delete(uri, null, null
  568. 复制代码

    23 添加到联系人:
  569. ContentValues cv = new ContentValues();  
  570.                     ArrayList<ContentProviderOperation> operationList = new ArrayList<ContentProviderOperation>();  
  571.                     ContentProviderOperation.Builder builder = ContentProviderOperation.newInsert(RawContacts.CONTENT_URI);  
  572.                     builder.withValues(cv);  
  573.                     operationList.add(builder.build());  
  574.                     builder = ContentProviderOperation.newInsert(Data.CONTENT_URI);  
  575.                     builder.withValueBackReference(StructuredName.RAW_CONTACT_ID, 0);  
  576.                     builder.withValue(Data.MIMETYPE, StructuredName.CONTENT_ITEM_TYPE);  
  577.                     builder.withValue(StructuredName.DISPLAY_NAME, "自定义联系人名");  
  578.                     operationList.add(builder.build());  
  579.                     builder = ContentProviderOperation.newInsert(Data.CONTENT_URI);  
  580.                     builder.withValueBackReference(Phone.RAW_CONTACT_ID, 0);  
  581.                     builder.withValue(Data.MIMETYPE, Phone.CONTENT_ITEM_TYPE);  
  582.                     builder.withValue(Phone.NUMBER, "联系人的phonenumber");  
  583.                     builder.withValue(Data.IS_PRIMARY, 1);  
  584.                     operationList.add(builder.build());  
  585.                     try {  
  586.                         getContentResolver().applyBatch(ContactsContract.AUTHORITY, operationList);  
  587.                     } catch (RemoteException e) {  
  588.                         e.printStackTrace();  
  589.                     } catch (OperationApplicationException e) {  
  590.                         e.printStackTrace();  
  591.                     }  
  592. 复制代码

    23 选择一个图片
  593. Intent intent = new Intent(Intent.ACTION_GET_CONTENT);   
  594. intent.addCategory(Intent.CATEGORY_OPENABLE);  
  595. intent.setType("image/*");  
  596. startActivityForResult(intent, 0);   
  597. 复制代码

    24 调用

    Android

    设备的照相机,并设置拍照后存放位置

  598. Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);  
  599. intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(new File(Environment .getExternalStorageDirectory().getAbsolutePath()+"/cwj", android123 + ".jpg"))); //存放位置为sdcard卡上cwj文件夹,文件名为android123.jpg格式  
  600. startActivityForResult(intent, 0);  
  601. 复制代码

    25 在market上搜索指定package name,比如搜索com.android123.cwj的写法如下
  602. Uri uri = Uri.parse("market://search?q=pname:com.android123.cwj");  
  603. Intent intent = new Intent(Intent.ACTION_VIEW, uri); startActivity(intent);
  604. 复制代码

    26获取文件信息,并使用相对应软件打开
  605. private void openFile(File f)    
  606. {    
  607.    Intent intent = new Intent();    
  608.    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);    
  609.    intent.setAction(android.content.Intent.ACTION_VIEW);    
  610.    String type = getMIMEType(f);    
  611.    intent.setDataAndType(Uri.fromFile(f), type);    
  612.    startActivity(intent);    
  613. }    
  614.    
  615. private String getMIMEType(File f){    
  616.    String end = f    
  617.        .getName()    
  618.        .substring(f.getName().lastIndexOf(".") + 1,    
  619.            f.getName().length()).toLowerCase();    
  620.    String type = "";    
  621.    if (end.equals("mp3") || end.equals("aac") || end.equals("aac")    
  622.        || end.equals("amr") || end.equals("mpeg")    
  623.        || end.equals("mp4"))    
  624.    {    
  625.      type = "audio";    
  626.    } else if (end.equals("jpg") || end.equals("gif")    
  627.        || end.equals("png") || end.equals("jpeg"))    
  628.    {    
  629.      type = "image";    
  630.    } else    
  631.    {    
  632.      type = "*";    
  633.    }    
  634.    type += "/*";    
  635.    return type;    
WorkBuddy 技能指南:基础办公与文档处理 WorkBuddy 不仅仅是一个对话工具——它通过技能(Skills)系统,将通用 AI 助手转变为具备专业领域能力的智能助手。每个技能都是一套经过精心设计的"能力包",包含专业知识、工作流程和专用工具。本文聚焦于文档处理类技能——这是日常工作中使用频率最高、最实用的能力集合。 阅读详情

相关推荐

蓝桥杯嵌入式(基础教程)STM32G431RBT6——创建工程以及点灯

首先选择正确的芯片类型:STM32G431RBT6工程的创建主要有配置时钟以及烧录的方式。在配置好之后需要对时钟进行配置,由于蓝桥杯的外部晶振是24MHz因此需要对时钟树进行相应的配置。第一步先点击时钟配置之后就可以对时钟进行相应的配置了最后一步,需要对工程起一个名字,并且要选择KEIL做为其相应的软件之后再需要再生成代码那里进行相应的控制。当然这样根据生成的工程不能直接使用会有一个报错,所以需要添加一个启动文件。这个启动文件可以在官方的LCD文件夹下复制到自己的工程中。

m0_74051113的博客 1093

android隐式intent安装apk,Android N 通过Intent安装APK

图片发自简书App封面图还是要有的之前使用Intent 安装APK文件,使用下面的代码可以直接调起安装界面。public void installAPK(Context context, File apkFile){Intent intent = new Intent(Intent.ACTION_VIEW);intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK...

weixin_42394100的博客 779

告别纯文本RAG:用Dify 1.11.0多模态知识库,5步搭建一个能“读图”的智能客服助手

本文详细介绍了如何利用Dify 1.11.0多模态知识库构建智能视觉客服助手,通过5个步骤实现图片内容理解与专业回复。从准备多模态素材到配置知识库节点,再到设计工作流逻辑和性能优化,帮助开发者快速搭建高效客服系统,显著提升用户体验和问题解决效率。

weixin_30832143的博客 456

Intent的跳转方式

第一种跳转方式 ,简单跳转 发送: Intent intent = new Intent(ActivityA.this, ActivityB.class); startActivity(intent); 第二种跳转方式,带数据跳转: 1.携带一些附加信息键值对 2.通过使用putextra()方法添加数据,使用getXXXExtra()方法获取数据 3.复杂数

TopWilling的博客 1045

【Ultrascale+ MPSOC学习记录】10、PS端以太网使用lwip

还是参考ALINX教程,学习PS端以太网如何使用,从教程中可以看到,开发板使用了一个xilinx默认不支持的phy JL2121,所以需要修改lwip的库源码。

ryo891012的博客 885

Python爬取京东商品数据保姆级教程(附源码及效果图)

本文介绍了一个基于Python的京东商品数据爬取教程,适合入门级开发者使用。文章详细讲解了从安装依赖库(DrissionPage、pandas等)到完成数据爬取的全过程,包括:1. 模拟用户搜索操作;2. 解析商品标题、价格、销量等关键信息;3. 处理复杂数据格式(如转换万级销量);4. 数据存储与Excel导出。教程提供了完整的封装函数,支持自定义搜索关键词和爬取数量,并包含错误处理和多种元素定位方式。最终数据会按时间戳命名导出为Excel文件,方便用于课程作业或毕业设计。

weixin_46449236的博客 1880

Android开发中使用Intent跳转到系统应用中的拨号界面、联系人界面、短信界面

版权 现在开发中的功能需要直接跳转到拨号、联系人、短信界面等等,查找了很多资料,自己整理了一下。 首先,我们先看拨号界面,代码如下:        Intent intent =new Intent(); intent.setAction("android.intent.action.CALL_BUTTON"); startActivity(intent); 和 Uri uri = Uri.parse("tel:xxxxxx"...

m0_64336946的博客 1713

汽车轮胎动平衡背后的秘密:如何用惯性主轴原理消除方向盘抖动

本文深入解析了汽车轮胎动平衡的核心原理,即利用惯性主轴原理消除高速行驶时的方向盘抖动。文章从方向盘抖动的现象出发,阐释了动不平衡产生的物理本质,并详细介绍了如何通过动平衡机测量、计算与校正,使轮胎-轮毂系统的实际旋转轴回归其惯性主轴,从而实现稳定运转。

grafana6viz的博客 348

Android 保存号码至已有联系人,新建联系人,读取手机联系人

添加必要的权限 <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.READ_CONTACTS"/> <uses-permission android:name="and...

shdhenghao3的专栏 5911

ABAP 7.40 新语法介绍系列之六:使用 FILTER 关键字对 ABAP 内表进行过滤

笔者之前写过的关于 ABAP 740 新语法的文章:本文介绍另一个新的关键字:FILTER.FILTER 是 ABAP 740 中引入的一个关键字,用于简化数据操作,它能够将内部表(Internal Table)中的数据按特定的条件进行过滤,并生成一个新的内部表。FILTER 的引入旨在使代码更加现代化和高效,尤其是在面对大量数据需要过滤的情况下。传统上,开发人员可能需要使用 LOOP AT 结合条件判断来实现,但使用 FILTER 关键字后,代码显得更加简洁且易于维护。

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 1185

硬件工程师提前批真题及答案解析2

我们需要考虑题目可能的简化假设,即输入电阻 Ri​ 可能是 rbe​ 和 βre​ 的组合,但题目可能简化为: Ri​≈rbe​+βre​。由于锗管的正向导通电压较小(0.2 V~0.3 V),而硅管的正向导通电压较大(0.6 V~0.7 V),因此-4.7 V的电压差不符合硅管的特性,而更接近锗管的特性。在三极管电路中,静态电位是指在无信号输入时,三极管各电极的直流电压。re​ 是动态发射极电阻,通常可以近似为 re​=IE​VT​​,但在题目中已经给出了 re​=300Ω,因此可以直接使用这个值。

XU157303764的博客 786

android SIM联系人(转)

<br />一、启动SIM联系人导入手机 INTENTview plaincopy to clipboardprint?// SIM import                                          Intent importIntent = new Intent(Intent.ACTION_VIEW);                                          importIntent.setType("vnd.android.cursor.item/

windizual的专栏 813

【原理图PCB专题】案例:双排0.5mm间距座子转单排0.5mm间距座子Layout方案分析

本文提供一种分析思路,并通过实际案例来进行Layout方案分析的讲解。

一点硬件 458

android intent和intent action大全

1.Intent的用法: (1)用Action跳转 1、使用Action跳转,如果有一个程序的AndroidManifest.xml中的某一个 Activity的IntentFilter段中 定义了包含了相同的Action那么这个Intent就与这个目标Action匹配。如果这个IntentFilter段中没有定义 Type,Category,那么这个 Activity就匹配了。但是如

Hackill 曰:敏而好学 不耻下问 994

迈瑞BS系列全自动生化分析仪LIS协议接口手册(内含HL7和ASTM)

迈瑞BS系列全自动生化分析仪LIS协议接口手册,内含HL7和ASTM)

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

《笑话大全》APP代码详解3

前面两章讲的启动页和引导页都不是重点,重点在本章所要讲到的主页面,因为主页面才应该是一个程序的核心,程序要展现什么,有什么功能都能够在主页面上体现出来,话不多说,还是先看代码。 public class MainActivity extends AppCompatActivity { //主页面的侧滑控件(Google官方控件) private DrawerLayout draw

aCandy的博客 619

IDEA的使用指南

IDEA基于java的使用手册,可以最快速的上手,在使用中不断的丰富自己的使用技巧.

android action大全

android intent和intent action大全 1.Intent的用法: (1)用Action跳转 1、使用Action跳转,如果有一个程序的AndroidManifest.xml中的某一个 Activity的IntentFilter段中 定义了包含了相同的Action那么这个Intent就与这个目标Action匹配。如果这个IntentFilter段中没有定义 Type,Ca

haojun186的专栏 922

霍尼韦尔SoftMaster使用说明

霍尼韦尔SoftMaster使用说明

Android页面跳转(Intent)

Android 意图的使用(Intent)显式四种跳转方式一二三四布局+代码效果隐式意图和隐式意图的跳转Intent概述Action属性 显式四种跳转方式 一 Intent intent = new Intent(MainActivity.this,HomeActivity.class); startActivity(intent); 二 Intent intent = new Intent(); intent.setClass(MainAc

Carryi的博客 1万+

Intent 在页面跳转时传递数据详解

Intent 是 Android 中用于组件间通信的重要机制,在 Activity 跳转时传递数据是最常见的用法之一。隐式Intent不指定具体的组件,而是通过指定action、category、data等属性,由系统匹配最适合的组件来处理。理解显式和隐式Intent的区别及适用场景,能帮助开发者更合理地设计Android应用的组件交互方式。显式Intent是明确指定了要启动的组件名称(如Activity、Service等)的Intent。:在应用内部组件间跳转时,显式Intent更安全高效。

百锦再的博客 1万+

安卓APP开发,从一个页面跳转到另一个页面的两种方式(intent 意图)

基于android-APP开发的页面跳转的两种方式(intent 意图) 一般来说,我们进行移动端安卓的开发是一道复杂的工序,因为我们需要的不止是一个页面,通常是很多页面的交互进行,所以,从一个页面跳转到另一个页面是安卓开发很重要的,也必须掌握的技能,本次博客将会讲解利用不同的Intent意图方式进行页面的跳转。 利用intent意图进行跳转,首先我们得对intent进行实例对象,如下: Inte...

qq_42451251的博客 8812

Android Intent实现页面跳转

什么是Intent Intent可以理解为信使(意图) 由Intent来协作完成Android各个组件之间的通讯, 也可以说是实现页面与页面之间的跳转 Intent实现页面之间的跳转 startActivity(intent)//第一种方式启动 startActivityForResult(intent, requestCode); //第二...

weixin_34242819的博客 1117

Android Studio 安卓使用Intent跳转页面、跳转网页、跳转电话、跳转页面传递数据

使用显示Intent 跳转页面 代码演示 public void exam_button(View view) { //控件点击事件 //创建Intent对象,传入两个参数,第一个是上下文,第二个是目标活动 Intent intent = new Intent(FirstActivity.this, SecondActivity.class); startActivity(intent);//启动方法,跳转页面 } 使用Intent的启动其它活动

nine_dollar的博客 2679

安卓——Intent(实现页面跳转的两种方法)

下图中两个不同的方法就是两种页面之间跳转的情况 1>跳转不返回数据 2>跳转返回数据 实例: 第一种启动方式(跳转不返回数据) 第二种启动方式(跳转返回数据) 先看第一种: 点击第一种启动方式按钮会出现右边的图,然后再点击Button按钮返回左边的界面,TextView中的内容没变。 再看第二种启动方式 不同的是,点击Button按钮返回左边的界面,Tex...

疯流人物 8919
上一篇: Android Intent 跳转到信息页面
下一篇: Android Intent 跳转打开某个应用
兴帅_
博客等级 码龄10年 218粉丝 781原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值