List of utility methods to do Activity Start
void | goToActivity(Context currentActivity, Class extends Activity> newClass) Switches to the given class (which must be a subclass of Activity). Intent newActivity = new Intent(currentActivity, newClass);
currentActivity.startActivity(newActivity);
|
void | goToActivity(Context currentActivity, Class extends Activity> newClass, List go To Activity Intent newActivity = new Intent(currentActivity, newClass); if (extras != null) { NameValuePair thisExtra = null; for (int x = 0; x < extras.size(); x++) { thisExtra = extras.get(x); newActivity.putExtra(thisExtra.getName(), thisExtra.getValue()); currentActivity.startActivity(newActivity); |
void | openActivity(Context packageContext, int flags, Map Purpose - Launch an activity if (packageContext == null) return; Intent intent = new Intent(packageContext, activity); intent.setFlags(flags); if (pairs != null && !pairs.isEmpty()) { Bundle extras = new Bundle(); for (Entry<String, String> pair : pairs.entrySet()) { extras.putString(pair.getKey(), pair.getValue()); ... |
void | startApkActivity(final Context ctx, String packageName) start Apk Activity PackageManager pm = ctx.getPackageManager(); PackageInfo pi; try { pi = pm.getPackageInfo(packageName, 0); Intent intent = new Intent(Intent.ACTION_MAIN, null); intent.addCategory(Intent.CATEGORY_LAUNCHER); intent.setPackage(pi.packageName); List<ResolveInfo> apps = pm.queryIntentActivities(intent, 0); ... |
void | restartActivity(final Activity activity) Restart the activity smoothly if (activity == null) return; final int enter_anim = android.R.anim.fade_in; final int exit_anim = android.R.anim.fade_out; activity.overridePendingTransition(enter_anim, exit_anim); activity.finish(); activity.overridePendingTransition(enter_anim, exit_anim); activity.startActivity(activity.getIntent()); ... |
void | restartPC(final Activity activity) Restart the activity smoothly if (activity == null) return; final int enter_anim = android.R.anim.fade_in; final int exit_anim = android.R.anim.fade_out; activity.overridePendingTransition(enter_anim, exit_anim); activity.finish(); activity.overridePendingTransition(enter_anim, exit_anim); activity.startActivity(activity.getIntent()); ... |
void | startActivity(Context context, Class> activity) start Activity Intent intent = new Intent(context, activity);
context.startActivity(intent);
|
void | startNewActivity(Class start New Activity Intent intent = new Intent(activity, target);
activity.startActivity(intent);
|
void | prepare(Activity activity, int id, int width) prepare if (sCoverBitmap != null) { sCoverBitmap.recycle(); Rect rectgle = new Rect(); Window window = activity.getWindow(); window.getDecorView().getWindowVisibleDisplayFrame(rectgle); int statusBarHeight = rectgle.top; ViewGroup v1 = (ViewGroup) activity.findViewById(id).getRootView(); ... |