Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 4th, 2011  |  syntax: Java  |  size: 0.95 KB  |  hits: 114  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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. }