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");