简体   繁体   中英

Is it possible to start an activity via ADB without animation

I know it's possible to have no animation when starting an activity via code ( here , for example), but is it possible to do so via adb too, even for activities that were supposed to have an animation ?

Also, is it possible to have no animation when going back from this opened activity?

Looking at the ADB Shell Activity Manager specification for arguments here: https://developer.android.com/studio/command-line/shell.html#IntentSpec

we can see that there is a -f option for Intent flags.

Th Intent flag FLAG_ACTIVITY_NO_ANIMATION has constant value: 65536

See: https://developer.android.com/reference/android/content/Intent.html#FLAG_ACTIVITY_NO_ANIMATION

Putting that together you could write something like:

am start -a com.example.ACTION_NAME -n com.package.name/com.package.name.ActivityName -f 65536

您可以使用以下命令通过adb启动活动,

am start -n yourpackagename/.activityname

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM