Android Question [Resolved]java.lang.IllegalStateException: Cannot perform this operation because there is no current

Douglas Farias

Expert
Licensed User
Longtime User
Hi why i have this error when i run my app on debug?
what the cause?

(Intent) Intent { act=android.intent.action.MAIN flg=0x20000000 cmp=click.fight.vallow/.main }
no extras
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = true **
** Activity (perfil) Create, isFirst = true **
** Activity (perfil) Resume **
** Service (httputils2service) Create **
** Service (httputils2service) Start **
Resposta do Servidor: []
Error occurred on line: 617 (perfil)
java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0
at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255)
at java.util.ArrayList.get(ArrayList.java:308)
at anywheresoftware.b4a.objects.collections.List.Get(List.java:117)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:485)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:229)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:174)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:93)
at anywheresoftware.b4a.BA$3.run(BA.java:318)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5102)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
Error saving object: (Exception) java.lang.Exception: java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0
Error occurred on line: 206 (perfil)
java.lang.IllegalStateException: Cannot perform this operation because there is no current transaction.
at android.database.sqlite.SQLiteSession.throwIfNoTransaction(SQLiteSession.java:915)
at android.database.sqlite.SQLiteSession.endTransaction(SQLiteSession.java:398)
at android.database.sqlite.SQLiteDatabase.endTransaction(SQLiteDatabase.java:522)
at anywheresoftware.b4a.sql.SQL.EndTransaction(SQL.java:268)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:519)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:235)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:174)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:93)
at anywheresoftware.b4a.BA$3.run(BA.java:318)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5102)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
Error saving object: (Exception) java.lang.Exception: java.lang.IllegalStateException: Cannot perform this operation because there is no current transaction.
Error occurred on line: 206 (perfil)
java.lang.IllegalStateException: Cannot perform this operation because there is no current transaction.
at android.database.sqlite.SQLiteSession.throwIfNoTransaction(SQLiteSession.java:915)
at android.database.sqlite.SQLiteSession.endTransaction(SQLiteSession.java:398)
at android.database.sqlite.SQLiteDatabase.endTransaction(SQLiteDatabase.java:522)
at anywheresoftware.b4a.sql.SQL.EndTransaction(SQL.java:268)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:519)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:235)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:174)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:93)
at anywheresoftware.b4a.BA$3.run(BA.java:318)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5102)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
Error saving object: (Exception) java.lang.Exception: java.lang.IllegalStateException: Cannot perform this operation because there is no current transaction.
Error occurred on line: 206 (perfil)
java.lang.IllegalStateException: Cannot perform this operation because there is no current transaction.
at android.database.sqlite.SQLiteSession.throwIfNoTransaction(SQLiteSession.java:915)
at android.database.sqlite.SQLiteSession.endTransaction(SQLiteSession.java:398)
at android.database.sqlite.SQLiteDatabase.endTransaction(SQLiteDatabase.java:522)
at anywheresoftware.b4a.sql.SQL.EndTransaction(SQL.java:268)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:519)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:235)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:174)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:93)
at anywheresoftware.b4a.BA$3.run(BA.java:318)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5102)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
** Activity (perfil) Pause, UserClosed = true **
 

Douglas Farias

Expert
Licensed User
Longtime User
resolved
added the permission and the correct folder make

code here

B4X:
    'cria pasta para salvar os textos
    If File.Exists(File.DirDefaultExternal, "clickfight" ) = False Then
    File.MakeDir(File.DirDefaultExternal, "clickfight")
    FP = File.Combine(File.DirDefaultExternal,"clickfight")
    Else
    FP = File.Combine(File.DirDefaultExternal,"clickfight")
    End If
   
   
    kv.Initialize(FP, "data")
 
Upvote 0
Top