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. iframe操作(跨域解决等)

    note:当页面内嵌入一个iframe实际上是在dom上新建了一个新的完整的window对象 iframe中取得主窗体 window.top (顶级窗口的window对象) window.parent ...

  2. js限定内容的溢出滚动(offset,style.left)

    1. .html: <div class="test" style="position: relative;"> <ul id="c ...

  3. HDU1541 经典树状数组

    HDU1541 题意: 如图,等级为0的点有1,等级为1得点有4,2  等级为2的点有3,等级为3的点有5-------即即左下角的点的个数 现给你一些点(x,y),输入顺序按y升序,y相等时按x升序 ...

  4. 【ZOJ4070】Function and Function(签到)

    题意:求 k 层嵌套的 f(x) 0<=x,k<=1e9 思路:迭代不会很多次后函数里就会=0或者1,再看层数奇偶直接返回答案 #include<cstdio> #includ ...

  5. kali 开启smb

    root@kali:~# smbpasswd -a rootNew SMB password:Retype new SMB password:root@kali:~# vi /etc/samba/sm ...

  6. 动态内存管理详解:malloc/free/new/delete/brk/mmap

    c++ 内存获取和释放 new/delete,new[]/delete[] c 内存获取和释放 malloc/free, calloc/realloc 上述8个函数/操作符是c/c++语言里常用来做动 ...

  7. UVA 763 Fibinary Numbers

    题意讲某个二进制按照规则每一位对应斐波那契数生成新的数字,然后2个数字求和.再求由该规则生成的二进制串.并且要求尽量用更大项的fib数(题目提示不能由连续的1就是2个连续的1(11)不如100更优) ...

  8. C++ 图像处理类库

    GIFLIB是一个 C 语言的 Gif 图像处理库.支持 Gif 图像读写. 如果需要单独处理某类图片格式,以上类库是比较好的选择,如果处理的格式种类比较多,下面的类库是比较好的选择. ImageMa ...

  9. UVALive 3507:Keep the Customer Satisfied(贪心 Grade C)

    VJ题目链接 题意: 知道n(n <= 8e6)个工作的完成所需时间q和截止时间d,你一次只能做一个工作.问最多能做多少工作? 思路: 首先很像贪心.观察发现如下两个贪心性质: 1)一定存在一个 ...

  10. POJ 3468.A Simple Problem with Integers-线段树(成段增减、区间查询求和)

    POJ 3468.A Simple Problem with Integers 这个题就是成段的增减以及区间查询求和操作. 代码: #include<iostream> #include& ...