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. Python之面向对象:类的内置方法

    1.def __add__(self,other): c1+c2 两个实例的加法操作就是执行__add__()方法 2.__str__(self): print一个实例的时候,执行的是__str__( ...

  3. J2SE总结(一)-------容器

    最近大家都在讨论容器以及如何在项目中去实际的应用它,由于之前对容器没有什么概念,所以把J2SE里面讲的容器的一些基础知识看了一下,总结一下最基本的东西. 围绕整章最核心的就属下面这张图了吧. 一.概念 ...

  4. 浅谈android Socket 通信及自建ServerSocket服务端常见问题

    摘  要:TCP/IP通信协议是可靠的面向连接的网络协议,它在通信两端各建立一个Socket,从而在两端形成网络虚拟链路,进而应用程序可通过可以通过虚拟链路进行通信.Java对于基于TCP协议的网络通 ...

  5. [译] 如何像 Python 高手一样编程?

    转自:http://www.liuhaihua.cn/archives/23475.html Harries 发布于 7天前 分类:编程技术 阅读(15) 评论(0) 最近在网上看到一篇介绍Pytho ...

  6. 关于backBarButtonItem的N种方法

    替换返回按钮的文字 很多app的要求所有的返回按钮的title都是“返回”,如果上一层题目文字太多,下一层的返回按钮文字就会显示不完全,而且这样可以使软件显得整洁. 方法一: 最普通的想法,A界面的n ...

  7. BootStrap容器介绍

    <!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="utf-8& ...

  8. PHP使用GOEASY实现WEB实时推送

    /** * 订单提醒 */ public function sendOrderNotice(){ //请求地址 $uri = "http://goeasy.io/goeasy/publish ...

  9. codeforces-723D

    题目连接:http://codeforces.com/contest/723/problem/D D. Lakes in Berland time limit per test 2 seconds m ...

  10. Codeforces Round #505 (rated, Div. 1 + Div. 2, based on VK Cup 2018 Final) -B C(GCD,最长连续交替序列)

    B. Weakened Common Divisor time limit per test 1.5 seconds memory limit per test 256 megabytes input ...