Android Tips (i)

Source: Internet
Author: User
<span id="Label3"></p><pre>1<span style="color: #000000;">, tune the Web browser Uri mybloguri = Uri.parse ("http://xxxxx.com"<span style="color: #000000;">); Returnit =<span style="color: #0000ff;">New<span style="color: #000000;">Intent (intent.action_view, mybloguri); 2<span style="color: #000000;">, map Uri Mapuri = Uri.parse ("geo:38.899533,-77.036476"<span style="color: #000000;">); Returnit =<span style="color: #0000ff;">New<span style="color: #000000;">Intent (intent.action_view, mapuri); 3<span style="color: #000000;">, assign the call interface Uri Teluri = Uri.parse ("tel:100861"<span style="color: #000000;">); Returnit =<span style="color: #0000ff;">New<span style="color: #000000;">Intent (intent.action_dial, teluri); 4<span style="color: #000000;">, Direct dial phone Uri Calluri = Uri.parse ("tel:100861"<span style="color: #000000;">); Returnit =<span style="color: #0000ff;">New<span style="color: #000000;">Intent (intent.action_call, calluri); 5<span style="color: #000000;">, uninstall Uri Uninstalluri = Uri.fromparts ("package", "xxx",<span style="color: #0000ff;">Null<span style="color: #000000;">); Returnit =<span style="color: #0000ff;">New<span style="color: #000000;">Intent (intent.action_delete, uninstalluri); 6<span style="color: #000000;">, install Uri Installuri = uri.fromparts ("package", "xxx",<span style="color: #0000ff;">Null<span style="color: #000000;">); Returnit =<span style="color: #0000ff;">New<span style="color: #000000;">Intent (intent.action_package_added, installuri); 7<span style="color: #000000;">, play Uri Playuri = Uri.parse ("file:///sdcard/download/everything.mp3"<span style="color: #000000;">); Returnit =<span style="color: #0000ff;">New<span style="color: #000000;">Intent (intent.action_view, playuri); 8<span style="color: #000000;">, dropped with outgoing mail Uri emailuri = uri.parse ("mailto:[email protected]"<span style="color: #000000;">); Returnit =<span style="color: #0000ff;">New<span style="color: #000000;">Intent (intent.action_sendto, emailuri); 9<span style="color: #000000;">, E-mail returnit =<span style="color: #0000ff;">New<span style="color: #000000;">Intent (intent.action_send); string[] tos = {"[email protected]"<span style="color: #000000;">}; string[] CCS = {"[email protected]"<span style="color: #000000;">};returnit.putextra (intent.extra_email, tos); Returnit.putextra (intent.extra_cc, ccs); Returnit.putextra ( intent.extra_text, "body"<span style="color: #000000;">); Returnit.putextra (intent.extra_subject, "SUBJECT"<span style="color: #000000;">); Returnit.settype ("message/rfc882"<span style="color: #000000;">); intent.createchooser (returnit, "Choose Email Client"<span style="color: #000000;">); 10<span style="color: #000000;">, send sms Uri Smsuri = Uri.parse ("tel:100861"<span style="color: #000000;">); Returnit =<span style="color: #0000ff;">New<span style="color: #000000;">Intent (intent.action_view, smsuri); Returnit.putextra ("sms_body", "yyyy"<span style="color: #000000;">); Returnit.settype ("vnd.android-dir/mms-sms"<span style="color: #000000;">); 11<span style="color: #000000;">, direct email Uri Smstouri = Uri.parse ("smsto://100861"<span style="color: #000000;">); Returnit =<span style="color: #0000ff;">New<span style="color: #000000;">Intent (intent.action_sendto, smstouri); Returnit.putextra ("sms_body", "yyyy"<span style="color: #000000;">); 12<span style="color: #000000;">, send mms Uri Mmsuri = Uri.parse ("content://media/external/images/media/23"<span style="color: #000000;">); Returnit =<span style="color: #0000ff;">New<span style="color: #000000;">Intent (intent.action_send); Returnit.putextra ("sms_body", "yyyy"<span style="color: #000000;">); Returnit.putextra (intent.extra_stream, mmsuri); returnit.settype ("image/png"<span style="color: #000000;">); last step: how does startactivity (returnit) make the background of button or ImageButton transparent or translucent? android:background= "@android: color/<span style="color: #000000;">Transparent "orandroid:background=" @null "<span style="color: #000000;">or translucent <button android:background= "#e0000000"/><span style="color: #000000;">Transparent <button android:background= "#00000000"/><span style="color: #000000;">How do I display HTML in textview? TextView tv=<span style="color: #000000;">(TextView) Findviewbyid (r.id.tv); spanned text = html.fromhtml ("<a href= ' http://www.baidu.com ' >baidu</a>"<span style="color: #000000;">); Tv.settext (text); If you have a picture in html, refer to this article: http:<span style="color: #008000;">//<span style="color: #008000;">da-en.iteye.com/blog/712415<span style="color: #000000;">How do I modify the soft keyboard defaults to digital input? EditText EditText =<span style="color: #000000;">(EditText) Findviewbyid (r.id.et); Edittext.setinputtype (inputtype.type_class_number); 13<span style="color: #000000;">. How do I prevent edittext from automatically ejecting input methods? Edittext.setontouchlistener (<span style="color: #0000ff;">New<span style="color: #000000;">Ontouchlistener () {<span style="color: #0000ff;">Public<span style="color: #0000ff;">Boolean<span style="color: #000000;">OnTouch (View v, motionevent Event) {<span style="color: #008000;">//<span style="color: #008000;">remember, Edittext's InputType is now Password.<span style="color: #0000ff;">int intype = Edittext.getinputtype ();<span style="color: #008000;">//<span style="color: #008000;">Backup the input type Edittext.setinputtype (inputtype.type_null);<span style="color: #008000;">//<span style="color: #008000;">Disable soft input edittext.ontouchevent (event);<span style="color: #008000;">//<span style="color: #008000;">Call Native Handler Edittext.setinputtype (intype);<span style="color: #008000;">//<span style="color: #008000;">Restore input type<span style="color: #000000;">Edittext.setselection (edittext.gettext (). Length ());<span style="color: #0000ff;">Return<span style="color: #0000ff;">True<span style="color: #000000;">; } }); 14<span style="color: #000000;">. How do I customize the title bar?<span style="color: #008000;">//<span style="color: #008000;">First you need to request a feature_custom_title operation<span style="color: #000000;">Requestwindowfeature (window.feature_custom_title); View =<span style="color: #0000ff;">New Snakeview (<span style="color: #0000ff;">This<span style="color: #000000;">); Setcontentview (view);<span style="color: #008000;">//<span style="color: #008000;">Then set<span style="color: #000000;">GetWindow (). setfeatureint (window.feature_custom_title, r.layout.title); R.layout.title corresponding layout file: <?xml version= "1.0" encoding= "UTF-8"?> <linearlayout xmlns:android= "/http Schemas.android.com/apk/res/android "<span style="color: #000000;">android:orientation= "horizontal"<span style="color: #000000;">Android:layout_width= "fill_parent"<span style="color: #000000;">android:layout_height= "fill_parent" > <<span style="color: #000000;">TextView android:id= "@+id/title"<span style="color: #000000;">Android:layout_width= "fill_parent"<span style="color: #000000;">android:layout_height= "wrap_content"<span style="color: #000000;">android:layout_weight= "1"<span style="color: #000000;">android:layout_gravity= "center"<span style="color: #000000;">android:gravity= "center"<span style="color: #000000;">android:text= "Snake"<span style="color: #000000;"><span style="color: #000000;">android:textcolor= "@color/red"/> </LinearLayout><span style="color: #000000;"> here to note, it is best not to modify the background color, otherwise the title bar will not be filled with the problem (will giveaway:)), If you really need to modify the background color and do not leak, then please see this article: http:<span style="color: #008000;">//<span style="color: #008000;">www.iteye.com/topic/760314 15. How do I hide the title bar? <span style="color: #000000;"> That is: the application name of the column <span style="color: #008000;">// <span style="color: #008000;">note: 2 lines of code can not be reversed in order <span style="color: #000000;">requestwindowfeature (window.feature_no_title); Setcontentview ( r.layout.main); <span style="color: #008000;">// <span style="color: #008000;">Use the hidden status bar to maximize the viewable area! <span style="color: #000000;">alternatively, You can set this in the manifest file: <application android:icon= "@drawable/icon"<span style="color: #000000;"> android:label= "@string/app_name" <span style="color: #000000;">android:theme= "@android: style/theme.notitlebar" ></span> </span> </span> </span> </span> </span> </span> </span> </span> </span> </span> </span> </span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></pre><p><p>Android Tips (i)</p></p></span>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.