android - Launching installedapplication -
how launch installed application?
i have installed using below: file file = new file(dir, "app.apk");
intent intent = new intent(intent.action_view); intent.setdataandtype(uri.fromfile(file), "application/vnd.android.package-archive"); startactivity(intent);
second time, checking if package installed, if yes, want launch.
intent intent = new intent(com.example.app);
thanks in advanced!
i'm using method. should change package , class names.
private static final string gps_status_package_name = "com.eclipsim.gpsstatus2"; private static final string gps_status_class_name = "com.eclipsim.gpsstatus2.gpsstatus"; /** * run gpsstatus & toolbox application * * @param context * can start activity */ public static void rungpsstatus(context context) { intent intent = new intent(intent.action_main); intent.setcomponent(new componentname(gps_status_package_name, gps_status_class_name)); list list = context.getpackagemanager().queryintentactivities(intent, packagemanager.component_enabled_state_default); if (list.size() > 0) { // have application context.startactivity(intent); } else { // none application } }
Comments
Post a Comment