1,调web浏览器
Uri myBlogUri = Uri.parse("http://xxxxx.com");
returnIt = new Intent(Intent.ACTION_VIEW, myBlogUri);
2,地图
Uri mapUri = Uri.parse("geo:38.899533,-77.036476");
returnIt = new Intent(Intent.ACTION_VIEW, mapUri);
3,调拨打电话界面
Uri telUri = Uri.parse("tel:100861");
returnIt = new Intent(Intent.ACTION_DIAL, telUri);
4,直接拨打电话
Uri callUri = Uri.parse("tel:100861");
returnIt = new Intent(Intent.ACTION_CALL, callUri);
5,卸载
Uri uninstallUri = Uri.fromParts("package", "xxx", null);
returnIt = new Intent(Intent.ACTION_DELETE, uninstallUri);
6,安装
Uri installUri = Uri.fromParts("package", "xxx", null);
returnIt = new Intent(Intent.ACTION_PACKAGE_ADDED, installUri);
7,播放
Uri playUri = Uri.parse("file:///sdcard/download/everything.mp3");
returnIt = new Intent(Intent.ACTION_VIEW, playUri);
8,掉用发邮件
Uri emailUri = Uri.parse("mailto:xxxx@gmail.com");
returnIt = new Intent(Intent.ACTION_SENDTO, emailUri);
9,发邮件
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,发短信
Uri smsUri = Uri.parse("tel:100861");
returnIt = new Intent(Intent.ACTION_VIEW, smsUri);
returnIt.putExtra("sms_body", "yyyy");
returnIt.setType("vnd.android-dir/mms-sms");
11,直接发邮件
Uri smsToUri = Uri.parse("smsto://100861");
returnIt = new Intent(Intent.ACTION_SENDTO, smsToUri);
returnIt.putExtra("sms_body", "yyyy");
12,发彩信
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");
最后一步:
startActivity(returnIt) 如何把Button或者ImageButton的背景设为透明或者半透明?
android:background=”@android:color/transparent”
or
android:background="@null"
or
半透明<Button android:background="#e0000000"/>
透明<Button android:background="#00000000"/> 如何在TextView显示HTML?
TextView tv=(TextView)findViewById(R.id.tv);
Spanned text = Html.fromHtml("<a href='http://www.baidu.com'>baidu</a>");
tv.setText(text);
如果html中有图片,请参考这篇文章:
http://da-en.iteye.com/blog/712415 如何修改软键盘默认为数字输入?
EditText editText = (EditText) findViewById(R.id.et);
editText.setInputType(InputType.TYPE_CLASS_NUMBER); 13.如何阻止EditText自动弹出输入法?
editText.setOnTouchListener(new OnTouchListener() { public boolean onTouch(View v, MotionEvent event) { //记住EditText的InputType现在是password
int inType = editText.getInputType(); // backup the input type
editText.setInputType(InputType.TYPE_NULL); // disable soft input
editText.onTouchEvent(event); // call native handler
editText.setInputType(inType); // restore input type
editText.setSelection(editText.getText().length());
return true; }
}); 14.如何自定义标题栏?
//首先需要请求对FEATURE_CUSTOM_TITLE操作
requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
view = new SnakeView(this);
setContentView(view);
//然后设置
getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.title);
R.layout.title对应的布局文件:
<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TextView
android:id="@+id/title"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="center"
android:gravity="center"
android:text="Snake"
android:textColor="@color/red"
/>
</LinearLayout>
这里需要注意,最好不要修改背景色,否则会出现标题栏不会被充满的问题(会露马脚啦:)),如果确实需要修改背景色又不漏马脚,那么请看这篇文章:
http://www.iteye.com/topic/760314 15.如何隐藏标题栏?
即:应用程序名称的那一栏
//注意:2行代码的先后顺序不能颠倒
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.main);
//同时使用隐藏状态栏可以使可视面积最大化!
或者也可以在Manifest文件中这样设置:
<application android:icon="@drawable/icon"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar">

Android 珍藏(一)的更多相关文章

  1. Android 珍藏(二)

    一.如何控制Android  LED等?(设置NotificationManager的一些参数) 代码如下: final int ID_LED=19871103; NotificationManage ...

  2. Android 珍藏(三)

    1.Android判断是Pad或者手机 public boolean isTabletDevice() { TelephonyManager telephony = (TelephonyManager ...

  3. 【Android珍藏】推荐10个炫酷的开源库【转】

    感谢大佬:https://www.jianshu.com/p/d608f0228fd4 前言 技术群里面经常有人问到一些炫酷的UI效果实现方法,有时候我都是给一个相同或者相似效果的Github链接,有 ...

  4. Android——android必看 各个控件属性(网上看到的文字,觉得挺好的,珍藏了)

    属性 值 说明 Android:orientation horizontal/vertical 设置布局水平还是垂直,默认是垂直 android:checked true/false 标记默认选中,如 ...

  5. android值得珍藏的6个开源框架技术

    1.volley  项目地址 https://github.com/smanikandan14/Volley-demo JSON,图像等的异步下载: 网络请求的排序(scheduling) 网络请求的 ...

  6. 珍藏40个android应用源码分享

    1.高仿京东商城源码http://www.apkbus.com/android-115203-1-1.html 2.抽屉demohttp://www.apkbus.com/android-115205 ...

  7. Android开发工具: AS, Gradle, Git等

    (一)史上最详细的Android Studio系列教程 你还没有使用Android Studio + Gradle么?那就有点太落伍了,下面自己原创总结了Android Studio的一系列教程,图文 ...

  8. 58. Android一些开发习惯总结

    作者:漫步 链接:https://www.zhihu.com/question/27227425/answer/35973793 来源:知乎 著作权归作者所有.商业转载请联系作者获得授权,非商业转载请 ...

  9. 【开发必备】吐血推荐珍藏的Chrome插件

    [开发必备]吐血推荐珍藏的Chrome插件 一:(Lying人生感悟.可忽略) 青春浪漫,往往难敌事故变迁.生命对每一个人都是平等的,彼此所经历的那就一定是彼此所必须经历的,它一定不是只为了折磨.消耗 ...

随机推荐

  1. vs2008升级正式版

    1.VS2008简体中文正式版序列号 1.Visual Studio 2008 Professional Edition: XMQ2Y-4T3V6-XJ48Y-D3K2V-6C4WT 2.Visual ...

  2. Ajax基础知识 浅析(含php基础语法知识)

    1.php基础语法    后缀名为.php的文件 (1) echo   向页面中输入字符串  <?php    所有php相关代码都要写在<?php ?>这个标签之中 echo &q ...

  3. 理解javascript的闭包,原型,和匿名函数及IIFE

    理解javascript的闭包,原型,和匿名函数(自己总结) 一 .>关于闭包 理解闭包 需要的知识1.变量的作用域 例1: var n =99; //建立函数外的全局变量 function r ...

  4. 汕头市队赛 SRM 08 B

    B-3 SRM 08 描述 给长度为 n 的数列 A 和长度为 m 的数列 B,问有多少长度为 m 的数列 C 满足 输入格式 第一行俩整数 n 和 m 第二行 n 个整数 ,表示数列 A 第三行 m ...

  5. linux select函数详解【转】

    转自:http://www.cnblogs.com/ccsccs/articles/4224253.html 在Linux中,我们可以使用select函数实现I/O端口的复用,传递给 select函数 ...

  6. C++笔试题目大全(笔试宝典)(不断完善中)

    1.new . delete . malloc . free 关系 delete 会调用对象的析构函数 , 和 new 对应 free 只会释放内存, new 调用构造函数. malloc 与 fre ...

  7. 错误整理:容器启动报错com.sun.faces.config.WebConfiguration cannot be cast to com.sun.faces.config....

    错误集锦: 今天用Jboss部署一个web项目的时候报了个奇怪的错误(用Tomcat部署运行良好),错误信息如下:java.lang.ClassCastException: com.sun.faces ...

  8. UbuntuMate开机自动启动ssh服务

    在文件/etc/init/ssh.conf中,有一句 start on filesystem or runlevel [2345] 如果想关闭自动启动的话,把这一局修改为start on runlev ...

  9. (2)C语言 基础2

    一.函数 二.指针 1.指针是一个用来存储内存地址的变量. int * p ; 定义了一个指针变量p,p中存储的是一个地址,改地址里必定会存储一个int类型的数据. *号表示变量p是一个指针.*和指针 ...

  10. 第十四届华中科技大学程序设计竞赛 B Beautiful Trees Cutting【组合数学/费马小定理求逆元/快速幂】

    链接:https://www.nowcoder.com/acm/contest/106/B 来源:牛客网 题目描述 It's universally acknowledged that there'r ...