Android Question onActivityResult: IOnActivityResult was released

fifiddu70

Well-Known Member
Licensed User
Longtime User
i have this problem....one help? post a little code,
I have to upload a photo gallery, just load the photo, do not visualize on the program, I think it is due to the problem that I resume activity releases the sub cc_result. how do I fix it?

B4X:
Sub img17_Click
    Dim cc As ContentChooser
    cc.Initialize("CC")
    cc.Show("image/*","Choose image")
   
   i.Initialize("")

brect.Initialize(0,0,imglogo.Width, imglogo.Height)

c.Initialize(imglogo)'
c.DrawColor(Colors.White)
c.DrawBitmap(b, Null, brect)
c.DrawText(metri.Text, 3%x,imglogo.Height-90%y,tf.CreateNew(Typeface.SERIF, Typeface.STYLE_BOLD), 20, Colors.Yellow , "LEFT")
c.DrawText(distanza.Text, 3%x,imglogo.Height-75%y,tf.CreateNew(Typeface.SERIF, Typeface.STYLE_BOLD), 35, Colors.Cyan , "LEFT")


i.Invalidate
    Panel2.Visible=False
    Panel1.Visible=True
    Panel3.Visible=False
    metri.Visible=True
    distanza.Visible=True
   
    btn1.Visible=True
    btncrea.Visible=False
    imgback.Visible=False
   
End Sub
Sub cc_Result (Success As Boolean, Dir As String, filename As String)
    If Success Then
   
    i.Initialize("")
    imglogo.Bitmap = LoadBitmapSample(Dir,filename,100%x,100%y)
    b.Initialize(Dir,filename)
    brect.Initialize(0,0,imglogo.Width, imglogo.Height)

    c.Initialize(imglogo)'
    c.DrawColor(Colors.White)
    c.DrawBitmap(b, Null, brect)
    c.DrawText(metri.Text, 3%x,imglogo.Height-90%y,tf.CreateNew(Typeface.SERIF, Typeface.STYLE_BOLD), 20, Colors.Yellow , "LEFT")
    c.DrawText(distanza.Text, 3%x,imglogo.Height-75%y,tf.CreateNew(Typeface.SERIF, Typeface.STYLE_BOLD), 35, Colors.Cyan , "LEFT")
    
    i.Invalidate
    metri.Visible=False
    distanza.Visible=False
   
    btn1.Visible=False
    Panel1.Visible = False
    Panel2.Visible=True
    Panel3.Visible=False
    Panel4.Visible=False
    Panel5.Visible=False
    imgback.Visible=True
    btncrea.Visible=True
    imgback.BringToFront
    btncrea.BringToFront
End If
End Sub
 

fifiddu70

Well-Known Member
Licensed User
Longtime User
I declared the variable DC in global process like you said and now it works fine, thank you erel
 
Upvote 0
Top