intent call summary (change)

2010-09-17  来源:本站原创  分类:Mobile  人气:216 

Display Web page:

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

Show Google Map:

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

Maps route planning:

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

Call:

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

1. Uri uri = Uri.parse ("tel.xxxxxx");
2. Intent it = new Intent (Intent.ACTION_CALL, uri);

Attention to the need permissions <uses-permission />

Send SMS / MMS

1. Intent it = new Intent (Intent.ACTION_VIEW);
2. It.putExtra ("sms_body", "android Development Network welcomes you");
3. It.setType ("vnd.android-dir/mms-sms");
4. StartActivity (it);

Send SMS

1. Uri uri = Uri.parse ("smsto: 10086");
2. Intent it = new Intent (Intent.ACTION_SENDTO, uri);
3. It.putExtra ("sms_body", "10086"); / / text to 10086
4. StartActivity (it);

Send MMS

1. Uri uri = Uri.parse ("content: / / media/external/images/media/10"); / / the Uri according to practical situation, external behalf of external storage that is sdcard
2. Intent it = new Intent (Intent.ACTION_SEND);
3. It.putExtra ("sms_body", "android123.com.cn");
4. It.putExtra (Intent.EXTRA_STREAM, uri);
5. It.setType ("image / png");
6. StartActivity (it);

Send Email

2. Uri uri = Uri.parse ("mailto: [email protected]");
3. Intent it = new Intent (Intent.ACTION_SENDTO, uri);
4. StartActivity (it);

1. Intent it = new Intent (Intent.ACTION_SEND);
2. It.putExtra (Intent.EXTRA_EMAIL, "[email protected]");
3. It.putExtra (Intent.EXTRA_TEXT, "android Development Network Test");
4. It.setType ("text / plain");
5. StartActivity (Intent.createChooser (it, "choose a Email client"));

1. Intent it = new Intent (Intent.ACTION_SEND);
2. String [] tos = ("[email protected]"); / / sent to
3. String [] ccs = ("[email protected]"); / / cc
4. It.putExtra (Intent.EXTRA_EMAIL, tos);
5. It.putExtra (Intent.EXTRA_CC, ccs);
6. It.putExtra (Intent.EXTRA_TEXT, "text");
7. It.putExtra (Intent.EXTRA_SUBJECT, "title");
8. It.setType ("message/rfc822"); / / encoding type
9. StartActivity (Intent.createChooser (it, "choose a Email client"));

Email Add attachments

1. Intent it = new Intent (Intent.ACTION_SEND);
2. It.putExtra (Intent.EXTRA_SUBJECT, "text");
3. It.putExtra (Intent.EXTRA_STREAM, "file: / / / sdcard/nobody.mp3"); / / accessories for the sd card nobody MP3 files
4. SendIntent.setType ("audio/mp3");
5. StartActivity (Intent.createChooser (it, "choose a Email client"));

Play Media

1.
2. Intent it = new Intent (Intent.ACTION_VIEW);
3. Uri uri = Uri.parse ("file: / / / sdcard/nobody.mp3");
4. It.setDataAndType (uri, "audio/mp3");
5. StartActivity (it);

1. Uri uri = Uri.withAppendedPath (MediaStore.Audio.Media.INTERNAL_CONTENT_URI, "1"); / / from the internal system called Play MediaProvider index
2. Intent it = new Intent (Intent.ACTION_VIEW, uri);
3. StartActivity (it);

Uninstall Uninstaller

1. Uri uri = Uri.fromParts ("package", packageName, null); / / packageName the package name, such as com.android123.apkInstaller
2. Intent it = new Intent (Intent.ACTION_DELETE, uri);
3. StartActivity (it);

Into the contact interface

Intent intent = new Intent ();
intent.setAction (Intent.ACTION_VIEW);
intent.setData (People.CONTENT_URI);
startActivity (intent);

View a contact, of course, here is ACTION_VIEW, if the action for the selection and return to ACTION_PICK, of course, when dealing with intent to return need to use startActivityforResult

Uri personUri = ContentUris.withAppendedId (People.CONTENT_URI, ID); / / Last contact Provider ID parameter in the database BaseID, that is what their
Intent intent = new Intent ();
intent.setAction (Intent.ACTION_VIEW);
intent.setData (personUri);
startActivity (intent);

Select a picture

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

Call Android device camera, and set a location for taking pictures

Intent intent = new Intent (MediaStore.ACTION_IMAGE_CAPTURE);
intent.putExtra (MediaStore.EXTRA_OUTPUT, Uri.fromFile (new File (Environment
. GetExternalStorageDirectory (). GetAbsolutePath ()+"/ cwj ", android123 +". Jpg "))); / / storage location for the sdcard card cwj folder, the file format is named android123.jpg
startActivityForResult (intent, 0);

Search on the specified package name in the market, such as the wording of the following search com.android123.cwj

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

相关文章
  • intent call summary (change) 2010-09-17

    Display Web page: 1. Uri uri = Uri.parse ("http://www.android123.com.cn"); 2. Intent it = new Intent (Intent.ACTION_VIEW, uri); 3. StartActivity (it); Show Google Map: 1. Uri uri = Uri.parse ("geo: 38.899533, -77.036476"); 2. Intent it

  • Android Intent usage summary 2010-04-12

    Android Intent usage summary Show page Uri uri = Uri.parse("http://google.com"); Intent it = new Intent(Intent.ACTION_VIEW, uri); startActivity(it); Show map Uri uri = Uri.parse("geo:38.899533,-77.036476"); Intent it = new Intent(Inten

  • Thread Summary (change) 2009-10-12

    That thread seems to be a very troublesome piece is a complex issue, in fact, true, related to thread programming is very particular about the technique. This requires us to change ways of thinking, to understand the mechanism of the more common thre

  • Sort Summary (change) 2010-03-26

    Sort summary reprinted JAVA Favorites package com.softeem.jbs.lesson4; import java.util.Random; /** * Sort Test class * * Sorting algorithm is as follows : * 1. Insertion Sort ( Direct insertion sort. Binary insertion sort . Sort Hill ): * 2. Exchang

  • The key processing mysql garbled summary (change) 2010-04-08

    mysql garbage treatment summary: (1) java in the normal processing of Chinese characters, garbage characters appear in the cmd client is a character set issue. (2) The field length is set long enough, but when prompted to insert Chinese characters co

  • mysql 5.0 stored procedure study summary (change) 2010-04-14

    1. Create a stored procedure 1. Basic syntax: create procedure sp_name () begin ... ... ... end 2. Parameter 2. Call a stored procedure 1. Basic syntax: call sp_name () Note: The stored procedure name must be followed by brackets, even if the stored

  • tomcat out of memory summary (change) 2010-04-16

    [Change] http://www.blogjava.net/beansoft/archive/2009/11/02/300662.html http://www.beckdim.cn/?p=110 Tomcat in a production environment is very vulnerable to bad memory settings of memory. Cause memory is not the same reason, of course, are not the

  • Sql optimization of large-scale systems development summary (change) 2010-04-20

    Problem Description: 1. The structure of each table and the primary key index case 2. Each table count (*) records the number of 3. To create an index of the column, the index of the type that? count (distinct indexcol) What is the value? 4. The last

  • Java Threads Summary (change) 2010-05-08

    In the forum thread above, I often see beginners on the helpless, so summed up the following article, I hope some are learning to use for beginners java thread help. First of all, the thread first need to know to understand some basic things, we are

  • Android Intent comprehensive summary of several usage (transfer) 2010-06-08

    Android Intent use a comprehensive summary of several Intent should be something peculiar to Android. You can specify the procedures Intent to perform actions (such as: view, edit, dial), and the program execution to the action when the required info

  • Android - Intent Action Summary (rpm) 2010-12-10

    String ADD_SHORTCUT_ACTION action: in the system to add a shortcut. . "Android.intent.action.ADD_SHORTCUT" String ALL_APPS_ACTION Action: List all available applications. Input: None. "Android.intent.action.ALL_APPS" String ALTERNATIVE

  • Oracle Explain plan to use summary (change) 2010-03-18

    Oracle Explain plan to use summary Writing more SQL statements, along with the sea by the amount of data will always encounter performance problems. Oracle area in a bad habit, experience performance problems when pushed to the DBA to do. So long, bu

  • Efficient SQL Summary (change) 2010-04-18

    Not only will we have to do to write SQL, but also achieve excellent performance to write SQL, the following is the author study, extract, and summarize some of the information to share with you! (1) Select the most efficient sequence table name (onl

  • jfreechart study summary (change) 2010-04-22

    JfreeChart recently learned their use, feel that Hasty's very powerful, to sum up. JfreeChart generated images are introduced in several ways Start point of the Internet is introduced. I. Introduction WW With the development of Internet-based applica

  • Java relative path / absolute path summary (change) 2010-05-06

    Java code 1. Basic understanding of the concept Absolute path: absolute path is your home page file or directory on your hard disk real path, (URL and the physical path) example: <DIV Class =quote_title> quote </ DIV> <DIV class =quote_div&

  • HTML article in the issue of interception summary [change] 2010-06-09

    Blog system is common practice, in the blog's home page only shows a summary of the article, click on the title into the future see the full text. Show what part of a summary of the problem is rather special, different systems have their own differen

  • Java relative path summary (change) 2010-06-09

    1. Basic understanding of the concept Absolute path: absolute path is your home page file or directory on your hard disk real path, (URL and the physical path) example: C: xyz est.txt represents the absolute path of the file test.txt. http://www.sun.

  • (All) JVM tuning Summary (change) 2010-07-24

    Original Source: http://pengjiaheng.spaces.live.com/blog/cns!2DAA368B386E6AEA!770.entry Recently concluded a number of things, is basically a summary of some of the information online. 1, related concepts Basic recovery algorithm Reference count (Ref

  • js cross-domain summary (change) 2010-09-02

    javascript for security considerations, is not allowed to cross-domain call the other page objects. However, security restrictions and also to inject iframe or ajax application brings a lot of trouble. Remember correctly, the first three D2 forum the

  • Chinese garbled summary (change) 2010-09-18

    In development, there will always encounter a variety of Chinese garbage problem, the following brief summary. 1, a database of garbled Garbled, we first response should be: if the database character encoding settings. To mysql, for example, bottles