大部分都来自网络上的文档。就不一一的列出转载的网址了。
Android应用开发——系统自带样式Android:theme
•android:theme="@android:style/Theme.Dialog" 将一个Activity显示为能话框模式
•android:theme="@android:style/Theme.NoTitleBar" 不显示应用程序标题栏
•android:theme="@android:style/Theme.NoTitleBar.Fullscreen" 不显示应用程序标题栏,并全屏
•android:theme="Theme.Light" 背景为白色
•android:theme="Theme.Light.NoTitleBar" 白色背景并无标题栏
•android:theme="Theme.Light.NoTitleBar.Fullscreen" 白色背景,无标题栏,全屏
•android:theme="Theme.Black" 背景黑色
•android:theme="Theme.Black.NoTitleBar" 黑色背景并无标题栏
•android:theme="Theme.Black.NoTitleBar.Fullscreen" 黑色背景,无标题栏,全屏
•android:theme="Theme.Wallpaper" 用系统桌面为应用程序背景
•android:theme="Theme.Wallpaper.NoTitleBar" 用系统桌面为应用程序背景,且无标题栏
•android:theme="Theme.Wallpaper.NoTitleBar.Fullscreen" 用系统桌面为应用程序背景,无标题栏,全屏
•android:theme="Translucent"
•android:theme="Theme.Translucent.NoTitleBar"
•android:theme="Theme.Translucent.NoTitleBar.Fullscreen"
•android:theme="Theme.Panel"
•android:theme="Theme.Light.Panel"
作者:月亮#
出处:http://ycmoon.cnblogs.com/
说明:1、本博客文章部分来源于互联网,如有异议,请及时联系本人:QQ:817647
2、如果要转载本文,请在文章页面明显位置给出原文连接,多谢合作。
Android Intent的几种用法全面总结
Intent应该算是Android中特有的东西。你可以在Intent中指定程序要执行的动作(比如:view,edit,dial),以及程序执行到该动作时所需要的资料。都指定好后,只要调用startActivity(),Android系统会自动寻找最符合你指定要求的应用程序,并执行该程序。
下面列出几种Intent的用法
显示网页:
Uri uri = Uri.parse("http://www.google.com");Intent it = new Intent(Intent.ACTION_VIEW,uri);startActivity(it);
显示地图:
1: Uri uri = Uri.parse("geo:38.899533,-77.036476");2: Intent it = new Intent(Intent.Action_VIEW,uri);3: startActivity(it);4:
路径规划:
1: Uri uri = Uri.parse("http://maps.google.com/maps?f=d&saddr=startLat%20startLng&daddr=endLat%20endLng&hl=en");2: Intent it = new Intent(Intent.ACTION_VIEW,URI);3: startActivity(it);
拨打电话:
调用拨号程序
1: Uri uri = Uri.parse("tel:xxxxxx");2: Intent it = new Intent(Intent.ACTION_DIAL, uri);3: startActivity(it);4: Uri uri = Uri.parse("tel.xxxxxx");5: Intent it =new Intent(Intent.ACTION_CALL,uri);
要使用这个必须在配置文件中加入
发送SMS/MMS
调用发送短信的程序
1: Intent it = new Intent(Intent.ACTION_VIEW);2: it.putExtra("sms_body", "The SMS text");3: it.setType("vnd.android-dir/mms-sms");4: startActivity(it);
发送短信
1: Uri uri = Uri.parse("smsto:0800000123");2: Intent it = new Intent(Intent.ACTION_SENDTO, uri);3: it.putExtra("sms_body", "The SMS text");4: startActivity(it);5:
发送彩信
1: Uri uri = Uri.parse("content://media/external/images/media/23");2: Intent it = new Intent(Intent.ACTION_SEND);3: it.putExtra("sms_body", "some text");4: it.putExtra(Intent.EXTRA_STREAM, uri);5: it.setType("image/png");6: startActivity(it);
发送Email
1: Uri uri = Uri.parse("mailto:xxx@abc.com");2: Intent it = new Intent(Intent.ACTION_SENDTO, uri);3: startActivity(it);4: Intent it = new Intent(Intent.ACTION_SEND);5: it.putExtra(Intent.EXTRA_EMAIL, "me@abc.com");6: it.putExtra(Intent.EXTRA_TEXT, "The email body text");7: it.setType("text/plain");8: startActivity(Intent.createChooser(it, "Choose Email Client"));9: Intent it=new Intent(Intent.ACTION_SEND);10: String[] tos={"me@abc.com"};11: String[] ccs={"you@abc.com"};12: it.putExtra(Intent.EXTRA_EMAIL, tos);13: it.putExtra(Intent.EXTRA_CC, ccs);14: it.putExtra(Intent.EXTRA_TEXT, "The email body text");15: it.putExtra(Intent.EXTRA_SUBJECT, "The email subject text");16: it.setType("message/rfc822");17: startActivity(Intent.createChooser(it, "Choose Email Client"));18:
添加附件
1: Intent it = new Intent(Intent.ACTION_SEND);2: it.putExtra(Intent.EXTRA_SUBJECT, "The email subject text");3: it.putExtra(Intent.EXTRA_STREAM, "file:///sdcard/mysong.mp3");4: sendIntent.setType("audio/mp3");5: startActivity(Intent.createChooser(it, "Choose Email Client"));6:
播放多媒体
1: Intent it = new Intent(Intent.ACTION_VIEW);2: Uri uri = Uri.parse("file:///sdcard/song.mp3");3: it.setDataAndType(uri, "audio/mp3");4: startActivity(it);5: Uri uri = Uri.withAppendedPath(MediaStore.Audio.Media.INTERNAL_CONTENT_URI, "1");6: Intent it = new Intent(Intent.ACTION_VIEW, uri);7: startActivity(it);8:
卸载程序
1: Uri uri = Uri.fromParts("package", strPackageName, null);2: Intent it = new Intent(Intent.ACTION_DELETE, uri);3: startActivity(it);
两个程序之间用Intent的明确调用
目标程序在AndroidManifest.xml文件的activity结点内添加如下声明:
1: <intent-filter>2: <action android:name="com.demo.intent.action.demo" />3: <category android:name="android.intent.category.DEFAULT" />4: intent-filter>
在调用程序里:
1: Intent it = new Intent("com.demo.intent.action.demo");2: startActivity(it);
3672




被折叠的 条评论
为什么被折叠?



