简体   繁体   中英

Please Help Me In Basic4Android

I'm learning Basic4Android. I want to use animation when I want to go to another activity. I Paste anim (animation files' folder) in my project folder/objects/res/.

I wrote codes. When I compile my project, anim folder automatically be deleted. And then my emulator (You Wave) gives an error that there is no animation files. My codes:

Sub Button1_Click
Activity.Finish
StartActivity("Menu")
AnimateLayout.SetAnimation("file3","file4")
End Sub

and my animation module codes:

'Code module
Sub Process_Globals

End Sub

Sub SetAnimation(InAnimation As String, OutAnimation As String)
Dim r As Reflector
Dim package As String
Dim In, out As Int
package = r.GetStaticField("anywheresoftware.b4a.BA", "packageName")

In = r.GetStaticField(File.DirAssets &"/anim",InAnimation)
out = r.GetStaticField(package & ".R$anim", OutAnimation)
r.Target = r.GetActivity
r.RunMethod4("overridePendingTransition", Array As Object(In, out), Array As 
String("java.lang.int", "java.lang.int"))
End Sub

What can I do?

You should set the anim folder or anim file to "read only" before compiling from basic4android.

I wish you good luck.

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