SHARE
TWEET

Untitled

a guest Jun 4th, 2011 121 Never
  1. package com.gflam.test;
  2.  
  3. import android.app.Activity;
  4. import android.content.Intent;
  5. import android.os.Build;
  6. import android.os.Bundle;
  7.  
  8. public class Open extends Activity {
  9.     /** Called when the activity is first created. */
  10.     @Override
  11.     public void onCreate(Bundle savedInstanceState) {
  12.         super.onCreate(savedInstanceState);
  13.         setContentView(R.layout.main);
  14.         showInstalledAppDetails("com.android.settings");
  15.     }
  16.     public void showInstalledAppDetails(String packageName) {
  17.         Intent intent = new Intent();
  18.         final int apiLevel = Build.VERSION.SDK_INT;
  19.             final String appPkgName = (apiLevel == 8 ? "pkg" : "com.android.settings.ApplicationPkgName");
  20.             intent.setAction(Intent.ACTION_VIEW);
  21.             intent.setClassName("com.android.settings", "com.android.settings.InstalledAppDetails");
  22.             intent.putExtra(appPkgName, packageName);
  23.         startActivity(intent);
  24.     }
  25. }
RAW Paste Data
Top