Show right-to-left Activity Animation when you click Home icon in your Android App (Dashboard Pattern)

September 6, 2011

Want to animate your activity from right to left when you click the home icon in the top left corner of your app?

Simples:


public static void goHomeTop(Activity context) {

final Intent intent = new Intent(context, HomeActivity.class);

intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);

context.startActivity(intent);

context.overridePendingTransition(android.R.anim.slide_in_left, android.R.anim.slide_out_right);

}

Advertisements

One Response to “Show right-to-left Activity Animation when you click Home icon in your Android App (Dashboard Pattern)”

  1. pablo Says:

    Hi Damian, great blog, i see that you are an expert on Augmented Reality for Android, please, can you check this? http://stackoverflow.com/questions/7566967/it-is-possible-to-know-if-the-phone-camera-is-facing-a-gps-point


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: