Add TabHost from db.txt

Theera

Expert
Licensed User
Longtime User
Hi all,
I have problem about Addition TabHost. How to add Tabhost from db.txt?
My code is attached below. Please corrected it for me.

Best Regards
Theera
 
Last edited:

klaus

Expert
Licensed User
Longtime User
In your post the db.txt file is missing !

But, could you explain in detail what exactly you want to do.
It seems also the you haven't understood how theTabHost Views is working nor do you understant what to do with layout files.

- You have panels in your layout files so you must not initialize them again.
- You load Layout2 and Layout3 onto the Activity why, it seems that you would have them on the TabHost so why loading them onto the Activity.
- Then you load Layout2 onto the TabHost and load several times Layout3 also onto the TabHost.

Without knowing what exactly you want to do and without the db.txt file it's impossible to help you.

Best regards.
 
Upvote 0

Theera

Expert
Licensed User
Longtime User
HelpDesk for Farmer.

Hi Klaus,
I'm sorry for disturb you again.I designed db.txt about faults and plants as below:-
[plant'sname1] => for header of tab host as tab1
aaa =a + b+c => aaa is Question1of plant'sname1 as choice1 and a+b+c is the answer1
bbb = i +j => bbb is Question2 of plant'sname1 as choice2 and i+j is the answer2
ccc = v+f => ccc is Question3 of plant'sname1 as choice3 and v+f is the answer3
[plant'sname2] => for header of tab host as tab2
xxx = w+r => Question1 of plant'sname2 as choice1 and w+r is the answer
yyy = y+o => Question2 of plant'sname2 as choice2 and y+o is the answer
zzz => g+h => Question3 of plant'sname2 as choice3 and g+h is the answer
Whenever user select one of tabs,user could select one or all of questions and then press the button(I don't yet create it) which created for search the answer of them.
ofcause another user could add more plant's names and prepare questions and answers and delete informations which don't wanted.

P.S. I'm sorry,I 'm not good at English.
Best Regards
Theera
:eek:
 
Upvote 0

Theera

Expert
Licensed User
Longtime User
Sorry, I still don't understand.
[plant'sname1] is this supposed to be the Tab header ?
And then:
- What are aaa, bbb, etc
- What are a + b + c, i + j etc.
etc.

Best regards.

Hi Klaus,
I'm sorry. the [plant'sname1] is format i.e. [rice],[mango],[durain],etc
the aaa,bbb is format i.e. the questions ask the time of the plant's life( while flowering or have insects disturb) as checked box and the a+b+c+c is fatmat of how to solved them as string which shown database to solved them.

Best regards
Theera
 
Last edited:
Upvote 0

Theera

Expert
Licensed User
Longtime User
I still have problem adding dinamic tabhost

Hi all,
Thank you,Klaus for encoding with UTF-8 with out BOM . I still have problem adding dynamic tabhost. I don't know to continue. I delete all of initalize of layout2 and layout3 already. I can add some Tabs ,but not most of them. I think For..Next Loop have problem

Best Regards
Theera
 
Last edited:
Upvote 0

klaus

Expert
Licensed User
Longtime User
Attached you find tow examples.
I'm not sure if it's what you expect.

How many plants will your file have ?
If there are many, TabHost is not the best solution.
A Spinner on top would be more efficient.
And then only one layout.

Best regards.
 

Attachments

  • Spinner.zip
    11.3 KB · Views: 198
  • TabHost.zip
    11.3 KB · Views: 213
Last edited:
Upvote 0

Theera

Expert
Licensed User
Longtime User
Thank you so much,Klaus
 
Upvote 0
Top