歡迎您光臨本站 註冊首頁

Android中跳轉到系統管理應用程序界面的方法

←手機掃碼閱讀     火星人 @ 2014-03-12 , reply:0
  

在編寫Android應用程序時,如果需要調用系統原生的管理應用程序界面呢?本人在一個項目中遇到過,本人沒有發現這方面現成的intent,不過通過看源代碼實現了。

 

Android源代碼application_settings.xml

  1. <PreferenceScreen  
  2.            Android:title="@string/manageapplications_settings_title"  
  3.            Android:summary="@string/manageapplications_settings_summary">  
  4.        <intent Android:action="android.intent.action.MAIN"  
  5.                Android:targetPackage="com.android.settings"  
  6.                Android:targetClass="com.android.settings.ManageApplications" />  
  7.    PreferenceScreen>  
熟悉PreferenceScreen的朋友應該知道如何做了,如果不熟悉的朋友,文章最後貼出一篇文章,大家參考一下就知道了,根據xml的描述,我們可以用如下代碼調用系統原生的管理應用程序界面
  1. Intent intent =  new Intent();  
  2. intent.setAction("Android.intent.action.MAIN");  
  3. intent.setClassName("com.Android.settings""com.android.settings.ManageApplications");  
  4. startActivity(intent);  
Android設置中的Preferencescreen用法介紹與分析:http://www.linuxidc.com/Linux/2011-10/45204.htm


[火星人 ] Android中跳轉到系統管理應用程序界面的方法已經有686次圍觀

http://coctec.com/docs/program/show-post-71520.html