Joke Collection Website - Public benefit messages - How to convert String to Uri and Uri to Drawable
How to convert String to Uri and Uri to Drawable
Link:/questionTerminal/7d924926f385474bbe6517e919f04eff?orderByHotValue=1&pos=2
Source: Niuke.com
Uri usage scenarios:
1. Adjust the web browser
Uri myBlogUri = Uri.parse(" ");
returnIt = new Intent(Intent.ACTION_VIEW, myBlogUri);
2. Map
Uri mapUri = Uri.parse("geo:38.899533,-77.036476");
returnIt = new Intent(Intent.ACTION_VIEW, mapUri);
3. Call the call interface
Uri telUri = Uri.parse("tel:100861");
returnIt = new Intent(Intent.ACTION_DIAL, telUri); < /p>
4. Make a call directly
Uri callUri = Uri.parse("tel:100861");
returnIt = new Intent(Intent.ACTION_CALL, callUri) ;
5, Uninstall
Uri uninstallUri = Uri.fromParts("package", "xxx", null);
returnIt = new Intent(Intent. ACTION_DELETE, uninstallUri);
6, Installation
Uri installUri = Uri.fromParts("package", "xxx", null);
returnIt = new Intent(Intent.ACTION_PACKAGE_ADDED, installUri);
7, play
Uri playUri = Uri.parse("file:///sdcard/download/everything.mp3"); < /p>
returnIt = new Intent(Intent.ACTION_VIEW, playUri);
8, call to send email
Uri emailUri = Uri.parse("mailto:xxxx@gmail .com");
returnIt = new Intent(Intent.ACTION_SENDTO, emailUri);
9, send email
returnIt = new Intent(Intent.ACTION_SEND );
String[] tos = { "xxxx@gmail.com" };
String[] ccs = { "xxxx@gmail.com" };
returnIt.putExtra(Intent.EXTRA_EMAIL, tos);
returnIt.putExtra(Intent.EXTRA_CC, ccs);
returnIt.putExtra(Intent.EXTRA_TEXT,
"body");
returnIt.putExtra(Intent.EXTRA_SUBJECT, "subject");
returnIt.setType("message/rfc882");
Intent.createChooser(returnIt, "Choose Email Client");
10, send text messages
Uri smsUri = Uri.parse("tel:100861");
< p>returnIt = new Intent(Intent.ACTION_VIEW, smsUri);returnIt.putExtra("sms_body", "yyyy");
returnIt.setType("vnd.android- dir/mms-sms");
11, send email directly
Uri smsToUri = Uri.parse("smsto://100861");
returnIt = new Intent(Intent.ACTION_SENDTO, smsToUri);
returnIt.putExtra("sms_body", "yyyy");
12, send MMS
Uri mmsUri = Uri.parse("content://media/external/images/media/23");
returnIt = new Intent(Intent.ACTION_SEND);
returnIt. putExtra("sms_body", "yyyy");
returnIt.putExtra(Intent.EXTRA_STREAM, mmsUri);
returnIt.setType("image/png");
- Previous article:Urgent reminder! Beware of ETC SMS fraud! People became victims.
- Next article:Sms audit
- Related articles
- Shandong provincial epidemic prevention and control headquarters telephone number?
- How do China Mobile users handle card downtime?
- Mid-Autumn Festival Valentine's Day blessing SMS
- When your son is 100 days old, I'll treat you to a meal for 100 days.
- My friend has opened a snack bar, but I am too busy to go there. I would like to send a red envelope on WeChat. Can I say some blessing words?
- What is the password of Alipay?
- How to activate SMS WoShield
- Ask for some classic humorous short messages
- Troubleshooting and Solution of Samsung Mobile Phone
- Axis Powers Hetalia's ending song Round Earth MP3+ Chinese lyrics+Roman pronunciation, all countries should sing it separately. Please send an email to some parents in 1439749598@qq.com.