Activity overridePendingTransition - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Activity overridePendingTransition method.

This code example shows how to use the following methods:overridePendingTransition, startActivity, getPackageName
    private static void startCameraActivity(Activity activity, String action,
            String className) {
        Intent intent = new Intent(action);
        intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
        intent.addFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT);
        intent.setClassName(activity.getPackageName(), className);
 
        // Keep the camera instance for a while. 
        // This avoids re-opening the camera and saves time. 
        CameraHolder.instance().keep(); 
 
        try { 
            activity.startActivity(intent);
        } catch (ActivityNotFoundException e) {
            intent.setComponent(null);
            activity.startActivity(intent);
        } 
        activity.overridePendingTransition(NO_ANIMATION, NO_ANIMATION);
    } 
 

7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:overridePendingTransition, startActivity
	 */ 
	public void launchActivity(Class<?> cls) {
		Log.v(TAG, "launch activity :" + cls.getName());
		Intent intent = new Intent();
		intent.setClass(mActivity, cls);
		mActivity.startActivity(intent);
 
	} 
 
	public void setToastResource(int[] resourceIds) {
		mToastEnabled = true;
		mToastResourcesMap = resourceIds;
	} 
 
	private void maybeShowToast(int whichActicity) {
		if (mToastEnabled && whichActicity < mToastResourcesMap.length) {
			final Toast myToast = new Toast(mActivity);
			final ImageView myView = new ImageView(mActivity);
			myView.setImageResource(mToastResourcesMap[whichActicity]);
			myToast.setView(myView);

7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:overridePendingTransition
 */ 
public class MethodsCompat { 
	 
    @TargetApi(5) 
    public static void overridePendingTransition(Activity activity, int enter_anim, int exit_anim) {
       	activity.overridePendingTransition(enter_anim, exit_anim);
    } 
 
    @TargetApi(7) 
    public static Bitmap getThumbnail(ContentResolver cr, long origId, int kind, Options options) {
       	return MediaStore.Images.Thumbnails.getThumbnail(cr,origId,kind, options);
    } 
     
    @TargetApi(8) 
    public static File getExternalCacheDir(Context context) {
 
//	    // return context.getExternalCacheDir(); API level 8 
// 
//	    // e.g. "<sdcard>/Android/data/<package_name>/cache/" 
//	    final File extCacheDir = new File(Environment.getExternalStorageDirectory(), 
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getWindow, overridePendingTransition, startActivity
    public static void startActivity(Activity currActivity, Intent intent, int splitYCoord) {
 
        // Preparing the bitmaps that we need to show 
        prepare(currActivity, splitYCoord);
 
        currActivity.startActivity(intent);
        currActivity.overridePendingTransition(0, 0);
    } 
 
    /** 
     * Start a new Activity with a Split animation right in the middle of the Activity 
     * 
     * @param currActivity The current Activity 
     * @param intent       The Intent needed tot start the new Activity 
     */ 
    public static void startActivity(Activity currActivity, Intent intent) {
        startActivity(currActivity, intent, -1);
    } 
 
    /** 

6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:overridePendingTransition
   * @param activity - The activity handling the animation 
   * @param enterAnim - The enter animation type 
   * @param exitAnim - The exit animation type 
   */ 
  public static void overridePendingTransitions(Activity activity, int enterAnim, int exitAnim) {
    activity.overridePendingTransition(enterAnim, exitAnim);
  } 
 
  /** 
   * Setup Dialog Box to request location permission from end-user for the Javascript 
   * location (navigator.geolocation.getCurrentLocation()) API. 
   * 
   * @param webview - The WebView component running the Javascript engine that needs permission 
   * @param activity - Its containing activity used for placing the dialog box 
   */ 
 
  public static void setupWebViewGeoLoc(final WebViewer caller, WebView webview, final Activity activity) {
    webview.getSettings().setGeolocationDatabasePath(activity.getFilesDir().getAbsolutePath());
    webview.getSettings().setDatabaseEnabled(true);
    webview.setWebChromeClient(new WebChromeClient() {
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:overridePendingTransition
 */ 
public class MethodsCompat { 
	 
    @TargetApi(5) 
    public static void overridePendingTransition(Activity activity, int enter_anim, int exit_anim) {
       	activity.overridePendingTransition(enter_anim, exit_anim);
    } 
 
    @TargetApi(7) 
    public static Bitmap getThumbnail(ContentResolver cr, long origId, int kind, Options options) {
       	return MediaStore.Images.Thumbnails.getThumbnail(cr,origId,kind, options);
    } 
     
    @TargetApi(8) 
    public static File getExternalCacheDir(Context context) {
 
//	    // return context.getExternalCacheDir(); API level 8 
// 
//	    // e.g. "<sdcard>/Android/data/<package_name>/cache/" 
//	    final File extCacheDir = new File(Environment.getExternalStorageDirectory(), 
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java

Related Activity overridePendingTransition Questions & Answers:

overridePendingTransition Method Overview
Call immediately after one of the flavors of startActivity(Intent) or finish() to specify an explicit transition animation to perform next.
See Code Examples for other Android Activity Methods: