Android Question Resolved: save content of Better Sliding Panels

anOparator

Active Member
Licensed User
Longtime User
I added editText to sliding panels.
EditText.text and the log for Left_Click shows changes happening, but I have been unable to Save a file after updating it.

Please send info/help on saving editText with these scripted views.

Thanks for all references.
 
Last edited:

anOparator

Active Member
Licensed User
Longtime User
B4X:
Sub Process_Globals
  Dim i As Int 'Create the views
B4X:
Sub Globals
   Dim sd As SlidingData 'The object that holds the data for SlidingPanels
   Dim story As EditText
B4X:
Sub Activity_Create(FirstTime As Boolean)
   'Create the panels.
   'In this example we are just creating 6 "dummy" panels with different colors.
   'It is possible to load a layout for each panel but this is slow and initializing the GUI
   'will take some time. It is really better to manually create the complete by code here.
If FirstTime Then
   If File.Exists(File.DirDefaultExternal, "0.txt") = False Then
   File.Copy(File.DirAssets, "0.txt", File.DirDefaultExternal, "0.txt")
   File.Copy(File.DirAssets, "1.txt", File.DirDefaultExternal, "1.txt")
   File.Copy(File.DirAssets, "2.txt", File.DirDefaultExternal, "2.txt")
   End If
End If
   Dim panels(3) As Panel
   For i = 0 To panels.Length - 1
     panels(i).Initialize("panels")
     panels(i).Color = Colors.White
     story.Initialize("")
     story.Text = File.ReadString(File.DirDefaultExternal,  i & ".txt")
     story.TextSize = 20
     story.TextColor = Colors.Black
     story.Gravity = 1
     panels(i).AddView(story, 5, 5, 95%x, 430dip)
     Activity.AddView(panels(i), 100%x, 0, 100%x, 100%y - 80dip) 'add the panel to the layout
   Next

B4X:
Sub Left_Click
   ChangePanel(SlidingPanels.PANEL_LEFT)

   'The next line cycles .txt files on device screen
File.ReadString(File.DirDefaultExternal, sd.currentPanel  & ".txt")
   Log (story.Text)  ' Only shows file # 2 of the panel array in the log.
   Log ("CLICK TO FILE # "  & sd.currentPanel & ".txt")

Am trying to show the device screen contents in the log. By knowing the object name to log I should the be able to :banghead Save the file. :banghead
 

Attachments

  • savePanel.zip
    15.1 KB · Views: 118
Upvote 0

anOparator

Active Member
Licensed User
Longtime User
mySolution,
Using ActionBar, it's more efficient for the task , bye bye Android 2.2 :(
 
Upvote 0
Top