Hola
cas6678
Al hacerlo de esa forma me sale un error, te dejo mi codigo con 2 Activity donde llamo a uno y regreso al principal
ub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
If FirstTime Then
Activity.LoadLayout("MenuPrincipal")
End If
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Menu_FACTURA_Click
StartActivity("FrmFacturacion")
End Sub
Sub Fact_BtnVolver_Click
StartActivity("MenuPrincipal")
End Sub
Sub Activity_KeyPress (KeyCode As Int) As Boolean 'Return True to consume the event
If KeyCode = KeyCodes.KEYCODE_BACK Then
Dim result As Int
result= Msgbox2("Desea Salir de la Aplicación?","Advertencia!!!","Si, salir ahora","", "No, cancelar",Null)
If result=DialogResponse.POSITIVE Then ExitApplication
If result=DialogResponse.NEGATIVE Then Return True
End If
Return True
End Sub
Sub Menu_SALIR_Click
Dim result As Int
result= Msgbox2("Desea Salir de la Aplicación?","Advertencia!!!","Si, salir ahora","", "No, cancelar",Null)
If result=DialogResponse.POSITIVE Then ExitApplication
End Sub
Aqui te dejo el error que me sale tanto en el dispositivo como en el emulador
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
main_menu_factura_click (java line: 389)
java.lang.ClassNotFoundException: b4a.example.frmfacturacion
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:324)
at java.lang.Class.forName(Class.java:285)
at anywheresoftware.b4a.keywords.Common.getComponentIntent(Common.java:940)
at anywheresoftware.b4a.keywords.Common.StartActivity(Common.java:840)
at b4a.example.main._menu_factura_click(main.java:389)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:186)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:170)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:166)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
at android.view.View.performClick(View.java:5198)
at android.view.View$PerformClick.run(View.java:21147)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: java.lang.ClassNotFoundException: Didn't find class "b4a.example.frmfacturacion" on path: DexPathList[[zip file "/data/app/b4a.example-1/base.apk"],nativeLibraryDirectories=[/data/app/b4a.example-1/lib/arm, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
... 20 more
Suppressed: java.lang.ClassNotFoundException: b4a.example.frmfacturacion
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 21 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
Gracias por tu colaboración