Well Didnt work. And this is what I found.... dont know why.
I started new project. with same elements.
And put a button to go to second form.
And step by step adding components and see.
The problem looks that its because jGridView.
FIRST STEPS
I got 2 jGridViews. I dont do anything to the gridviews. just placed in dessign. no data in them... nothing.
Forms, both just with controls (graphic) and some variable declarations.
When hitting button opens second. and when clicking BACK comes to main again
Using:
procedure TAndroidModule1.jButton1Click(Sender: TObject);
begin
if(AndroidModule2= nil) then
begin
gApp.CreateForm(TAndroidModule2,AndroidModule2);
AndroidModule2.Init(gApp);
end
else
begin
AndroidModule2.Show;
end;
end;
SECOND STEP:
in JNIPrompt I make a call to :preparagrid
I set in main form:
procedure TAndroidModule1.preparagrid;
var
row,col:integer;
begin
with jGridView2 do begin
Clear;
ColCount:=8;
row:=0;
jGridView2.AddRow(row);
jGridView2.Cells[0,row]:='ID';
jGridView2.Cells[1,row]:='PEDIDO';
jGridView2.Cells[2,row]:='CLIENTE';
jGridView2.Cells[3,row]:='REF CLIENTE';
jGridView2.Cells[4,row]:='SERVIDA';
jGridView2.Cells[5,row]:='FORR HOJA';
jGridView2.Cells[6,row]:='FORR BASTI';
jGridView2.Cells[7,row]:='MAT SUELTO';
end;
end;
AND FAILS.
so, what I have to do is set a boolean variable (grid_set_enable)
set to false at activitycreate
and in JniPrompt if its false I call preparagrid, and then set it to true.
NOW it works.