Android系统Intent的使用
来源:互联网 发布:ppt图表编辑数据没反应 编辑:程序博客网 时间:2024/05/17 07:48
- Uri uninstallUri = Uri.fromParts("package", "xxx", null);
- returnIt = new Intent(Intent.ACTION_DELETE, uninstallUri);
install apk
- Uri installUri = Uri.fromParts("package", "xxx", null);
- returnIt = new Intent(Intent.ACTION_PACKAGE_ADDED, installUri);
play audio
- Uri playUri = Uri.parse("file:///sdcard/download/everything.mp3");
- returnIt = new Intent(Intent.ACTION_VIEW, playUri);
- //发送附件
- Intent it = new Intent(Intent.ACTION_SEND);
- it.putExtra(Intent.EXTRA_SUBJECT, "The email subject text");
- it.putExtra(Intent.EXTRA_STREAM, "file:///sdcard/eoe.mp3");
- sendIntent.setType("audio/mp3");
- startActivity(Intent.createChooser(it, "Choose Email Client"));
- //搜索应用
- Uri uri = Uri.parse("market://search?q=pname:pkg_name");
- Intent it = new Intent(Intent.ACTION_VIEW, uri);
- startActivity(it);
- //where pkg_name is the full package path for an application
- //显示指定应用的详细页面(这个好像不支持了,找不到app_id)
- Uri uri = Uri.parse("market://details?id=app_id");
- Intent it = new Intent(Intent.ACTION_VIEW, uri);
- startActivity(it);
- //where app_id is the application ID, find the ID
- //by clicking on your application on Market home
- //page, and notice the ID from the address bar
/**
* 获得包安装Intent
* @param tempFile
* @return
*/
public static Intent getPackageInstallIntent(File tempFile)
{
Uri mPackageURI = Uri.fromFile(tempFile);
Intent in = new Intent();
in.setAction(Intent.ACTION_VIEW);
in.addCategory(Intent.CATEGORY_DEFAULT);
in
.setComponent(new ComponentName(
"com.android.packageinstaller",
"com.android.packageinstaller.PackageInstallerActivity"));
in.setDataAndType(mPackageURI,
"application/vnd.android.package-archive");
in.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
return in;
}
* 获得包安装Intent
* @param tempFile
* @return
*/
public static Intent getPackageInstallIntent(File tempFile)
{
Uri mPackageURI = Uri.fromFile(tempFile);
Intent in = new Intent();
in.setAction(Intent.ACTION_VIEW);
in.addCategory(Intent.CATEGORY_DEFAULT);
in
.setComponent(new ComponentName(
"com.android.packageinstaller",
"com.android.packageinstaller.PackageInstallerActivity"));
in.setDataAndType(mPackageURI,
"application/vnd.android.package-archive");
in.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
return in;
}
- Android系统Intent的使用
- Android系统Intent的使用
- Android系统Intent的使用
- Android 系统应用调用,intent的使用
- android系统调用 Intent的使用大全
- Android系统中标准Intent的使用
- Android系统中标准Intent的使用
- Android系统中标准Intent的使用
- Android系统中标准Intent的使用
- Android系统中标准Intent的使用
- Android系统中标准Intent的使用
- Android系统中标准Intent的使用
- Android系统中标准Intent的使用
- Android系统中标准Intent的使用
- Android系统中标准Intent的使用
- Android系统中标准Intent的使用
- Android系统中标准Intent的使用
- Android系统中标准Intent的使用
- 理解HTTP幂等性
- 同步FIFO分析及rtl代码
- Python学习笔记--help命令使用
- C语言文件操作解析之EOF解析
- Palindrome
- Android系统Intent的使用
- android SQLite使用SQLiteOpenHelper类对数据库进行操作
- oracle字符集乱码问题
- JS实现阻止冒泡事件
- redis数据结构之整数集合
- 用qmake快速生成makefile
- 面向“接口”编程和面向“实现”编程
- c语言的int
- how to reslove java.lang.UnsupportedClassVersionError: Bad version number in .class file