Android打开系统自带应用管理画面

MainActivity如下:

package cc.testsetting;

import android.net.Uri;
import android.os.Bundle;
import android.provider.Settings;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.app.Activity;
import android.content.Intent;
/**
 * Demo描述:
 * 跳转到系统自带的应用管理画面
 * 或者跳转到系统自带的应用管理画面下的某个App的管理画面
 *
 * 参考资料:
 * http://jykenan.iteye.com/blog/1654925
 * Thank you very much
 */
public class MainActivity extends Activity {
   private Button mManageAppButton;
   private Button mManageAppsButton;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
		init();
	}

	private void init(){
		mManageAppButton=(Button) findViewById(R.id.manageAppButton);
		mManageAppButton.setOnClickListener(new ClickListenerImpl());
		mManageAppsButton=(Button) findViewById(R.id.manageAppsButton);
		mManageAppsButton.setOnClickListener(new ClickListenerImpl());
	}

	private class ClickListenerImpl implements OnClickListener{
		@Override
		public void onClick(View v) {
			switch (v.getId()) {
			case R.id.manageAppButton:
				Intent manageAppIntent = new Intent();
				manageAppIntent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
				//第二个参数为包名
				Uri uri = Uri.fromParts("package", "cc.testsetting", null);
				manageAppIntent.setData(uri);
				startActivity(manageAppIntent);
				break;

			case R.id.manageAppsButton:
				Intent manageAppsIntent =  new Intent();
				manageAppsIntent.setAction("android.intent.action.MAIN");
				manageAppsIntent.setClassName("com.android.settings", "com.android.settings.ManageApplications");
			    startActivity(manageAppsIntent);
				break;

			default:
				break;
			}

		}

	}

}

 

main.xml如下:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    >

    <Button
        android:id="@+id/manageAppButton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:text="ManageApp"
        android:layout_marginTop="120dip"
    />

    <Button
        android:id="@+id/manageAppsButton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:text="ManageApps"
        android:layout_marginTop="250dip"
    />

</RelativeLayout>

 

时间: 2024-09-08 10:41:02

Android打开系统自带应用管理画面的相关文章

Android调用系统自带浏览器打开网页的实现方法

在Android中可以调用自带的浏览器,或者指定一个浏览器来打开一个链接.只需要传入一个uri,可以是链接地址. 启动android默认浏览器 在Android程序中我们可以通过发送隐式Intent来启动系统默认的浏览器.如果手机本身安装了多个浏览器而又没有设置默认浏览器的话,系统将让用户选择使用哪个浏览器来打开连接. Uri uri = Uri.parse("https://www.baidu.com"); Intent intent = new Intent(Intent.ACTI

Android中系统自带锁WalkLock与KeyguardLock用法实例详解

本文实例讲述了Android中系统自带锁WalkLock与KeyguardLock用法.分享给大家供大家参考,具体如下: WalkLock - 顾名思义 唤醒锁 点亮屏幕用的 KeyguardLock - 顾名思义 键盘锁 解锁键盘用的 详细介绍: 1: WalkLock 唤醒锁 - WalkLock真的能点亮屏幕吗? 答案是肯定的. 可是有时候为什么不点亮屏幕,这个就是参数设置的问题了. 复制代码 代码如下:PowerManager.newWakeLock(PowerManager.FULL_

Win8如何打开系统自带录音机程序

Win8打开系统自带录音机程序的方法如下: 方法一:在正常桌面中,按键盘的 F3 按键,键入"录音机"并回车搜索,然后点击选择"录音机". 方法二:使用组合热键"Win+R"调出运行对话框,输入"soundrecorder",确定后打开"录音机"程序. 方法三:在Metro界面,然后单击鼠标右键,点击屏幕下方出现的"所有程序",在"所有程序"界面,找到Windows附

拍照-Android 打开系统照相机问题

问题描述 Android 打开系统照相机问题 下面描述的代码怎么写? 直接打开系统照相机就行了,打开的时候不能出现使用第三方拍照的提示!而且不需要传文件保存路径.文件名称等,就跟平常打开手机相机拍照一样. 解决方案 http://blog.csdn.net/qq_27665781/article/details/49815827 可以用 解决方案二: android照相机android 调用系统照相机Android调用系统照相机

android使用系统自带的播放器播放视频报错

问题描述 android使用系统自带的播放器播放视频报错 Intent intent = new Intent(android.content.Intent.ACTION_VIEW); Uri uri = Uri.parse(FileUtils.SDCARD_PATH + "/" + getItem(position).getName()); intent.setDataAndType(uri, "video/*"); mContext.startActivity(

android 中系统自带的主题与样式(theme and style)

android:theme="@android:style/Theme.Dialog" 将一个Activity显示为能话框模式 android:theme="@android:style/Theme.NoTitleBar" 不显示应用程序标题栏 android:theme="@android:style/Theme.NoTitleBar.Fullscreen" 不显示应用程序标题栏,并全屏 android:theme="Theme.Li

使用Windows7系统自带磁盘管理工具调整硬盘分区大小

Windows 7操作系统本身就自带了很多系统管理配置工具,例如对硬盘分区进行调整的磁盘管理器.在Windows XP时候我们需要使用一些第三方软件来对硬盘分区进行管理,如新建分区.格式化.调整分区大小.合并分区等多种操作.所以现在购买了一台新电脑,在安装 Windows 7系统时我们不必在意如何分区,分区的硬盘大小调整操作都可以放到系统安装完成后进行.本例中我们看一下如何在已安装Windows 7的电脑上调整硬盘分区大小的. 首先运行磁盘管理 工具:点击左下角的微软图标,在搜索框中输入disk

Android 开发系统自带语音模块应用_Android

需求:项目中需要添加语音搜索模块,增加用户体验 解决过程:在网上搜到语音搜索例子,参考网上代码,加入到了自己的项目,完成产品要求.这个问题很好解决,网上能找到很多的资料,但是没有直接导入工程就能用的例子,我这里写了一个完整的Demo,代码可以直接粘贴到自己项目中去,实现了 语音搜索,并将搜索结果展示. 语音搜索大致流程:启动系统自带的Intent,Intent参数设置为RecognizerIntent.ACTION_RECOGNIZE_SPEECH,再加上一些提示参数 intent.putExt

Android改变系统自带环形ProgressBar的大小

MainActivity如下: package cc.testprogressbar; import android.os.Bundle; import android.app.Activity; /** * Demo描述: * 改变系统自带环形ProgressBar的大小 * * 改变方式: * 为ProgressBar设置一个style即可 * 参见styles.xml * */ public class MainActivity extends Activity { @Override p