last day (14 days later) » 

12:23 PM
Hi John!
Sorry, please repeat how your program are working at this moment? What you have and what you need.
*What do you have
 
 
1 hour later…
1:57 PM
Hi...
Here?
:(
 
ya
I am here
 
Great..
 
))
Maybe your paste all your code on github or bitbucket?
 
Can you wait for 10 more minutes
I outside now
 
ok
 
2:12 PM
Github?
 
If you dont know what is it, we miss that part)
 
Ok.. We chat later
You will online right?
 
yes
 
:)
 
two hours I stay online
 
2:28 PM
hi
I'm back
Did you understand my problem?
 
so so
you have 3 spinners, ea?
 
ya
i want to retrieve the data from sqlite and display on the spinner
and I want the selected item display first
 
which items the spinners have?
or items must retrieve from data base?
 
In my case, I have 3 spinner item and they have item {1,2,3}
Let say in spinner1, it saved value 1, spinner 2 saved value 2...to database
now I want to retrieve the values out by using another 3 spinner
let say spinner A,B,C
Spinner A,B,C has item {1,2,3} also
but I want spinner A shows A first
then spinner B shows 2 first..
 
Maybe Spinner A shows 1 first?
 
2:39 PM
ya..
sorry, type wrongly
It depends
 
ok I got it
check this string: String Project11 = c.getString(c.getColumnIndexOrThrow(MyDatabaseHelper.Project));
 
If spinner 1 saved 3 in database
then spinner A has to displayed 3
 
what you get? what value of Project11
do you know how it check? after put: Log.e("TAG", Project11);
and check LogCat
 
ok
wait
 
2:53 PM
so I just check 1 only ?
 
no, you may ckeck all variabels Project12, Project13 ...
I want to watch what you get from database
 
ok
i use list.add("Pro-XXX-XXX");
list.add("TRN-XXX-XXX");
list.add("SRV-XXX-XXX");
list.add("PRO-REE-BERGARDING");
list.add("PRO-SKM-SSS");
list.add("PRO-SKM-DI");
list.add("PRO-SKM-PACKING");
list.add("PRO-SIE-AVAGO_S110");
list.add("PRO-SIE-BIOCON");
list.add("PRO-BCM-T13/T17");
list.add("TRIN-IN_HOUSE");
list.add("TRIN-EXTERNAL");
list.add("SRIV-SIE-LEMONGRASS");
list.add("SRV-PW-SIMOCODE");
list.add("SRV-REE-SIMOCODE");
list.add("PRO-SKM-D5");
list.add("PRO-SKM-DRIOU");
list.add("PRO-BKI-DESMET");
all this
instead of 1,2,3
 
ok, it is right all data from spinner 1, spinner2, spinner 3, ya?
 
and I have 4 spinner
now I display what I get in the 4 spinner
ya,items in spinner
spinner1 I insert SRV-XXXX
spinner 2-insert TRN
spinner3 and 4 insert Pro
 
hm
maybe screenshots?)
all data is all right, you want only set right spinner position?
 
3:01 PM
ya
wait..I insert value first
 
ok, so you don't save your selected position from spinner1, spinner2, spinner3?
maybe you must passed selected position from previous activities? and that's all
 
mean?
how can I set the position
 
spinner.setSelection(0);
0 - is first position
1 - is second position
 
where should I put
 
after this block:
 
3:07 PM
addProject1(Project11);
addProject2(Project22);
addProject3(Project33);
WD.setProject(Project11);
WD.setProject(Project22);
WD.setProject(Project33);
 
addProject1(Project11);
addProject2(Project22);
addProject3(Project33);
WD.setProject(Project11);
WD.setProject(Project22);
WD.setProject(Project33);
project1.setSelection(0);
 
then ?
 
you asked: "how can I set the position" - project1.setSelection(0);
 
ya
project1.setSelection(0);
project2.setSelection(1)
...
like that ?
 
ya
all right
project3.setSelection(2);
 
3:13 PM
Inside the while loop ?
 
hm
no
after that:
while (c.moveToNext()) {
Details WD = new Details();
String Project11 = c.getString(c.getColumnIndexOrThrow(MyDatabaseHelper.Project));
String Project22 =c.getString(c.getColumnIndexOrThrow(MyDatabaseHelper.Project));
String Project33 =c.getString(c.getColumnIndexOrThrow(MyDatabaseHelper.Project));

addProject1(Project11);
addProject2(Project22);
addProject3(Project33);
WD.setProject(Project11);
WD.setProject(Project22);
WD.setProject(Project33);
}
 
after c.close()
?
 
finally like this
if (c != null) {
while (c.moveToNext()) {
Details WD = new Details();
String Project11 = c.getString(c.getColumnIndexOrThrow(MyDatabaseHelper.Project));
String Project22 =c.getString(c.getColumnIndexOrThrow(MyDatabaseHelper.Project));
String Project33 =c.getString(c.getColumnIndexOrThrow(MyDatabaseHelper.Project));

addProject1(Project11);
addProject2(Project22);
addProject3(Project33);
WD.setProject(Project11);
WD.setProject(Project22);
WD.setProject(Project33);
}

project1.setSelection(0);
project2.setSelection(1);
 
anything I still need to add?
 
better like this:
if (c != null) {
while (c.moveToNext()) {
Details WD = new Details();
String Project11 = c.getString(c.getColumnIndexOrThrow(MyDatabaseHelper.Project));
String Project22 =c.getString(c.getColumnIndexOrThrow(MyDatabaseHelper.Project));
String Project33 =c.getString(c.getColumnIndexOrThrow(MyDatabaseHelper.Project));

addProject1(Project11);
addProject2(Project22);
addProject3(Project33);
WD.setProject(Project11);
WD.setProject(Project22);
WD.setProject(Project33);
}

project1.setSelection(0);
project2.setSelection(1);
that is what you need?
 
3:19 PM
wait
Not what I want
 
))
 
what's wrong
here
 
What you see? how works at this time?
maybe more information or screenshots?
 
ok
give me some time
 
I really do not clear understand you
ok
 
3:41 PM
ok
public class UpdatePage2 extends Fragment {

SQLiteDatabase database;
MyDatabaseHelper dbHelper;
Cursor c;
Spinner weather3,status3,project1,project2,project3,project4;
EditText name3;
EditText date3;
String date;
String ID;
String Project11;
String Project22;

public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// TODO Auto-generated method stub
View view = inflater.inflate(R.layout.u, container, false);
dbHelper = new MyDatabaseHelper(getActivity());
This is the code used to retrieve the spinner item out
In spinner 1, I insert SRV
In spinner 2, I insert TRN
But this is what I get
cannot send image to you, reputation low ==
 
you may upload to another site and put link here
 
The two log display 11-23 15:38:37.732 5977-5977/? E/TAG﹕ TRN-XXX-XXX
11-23 15:38:37.732 5977-5977/? E/TAG﹕ TRN-XXX-XXX
github/
?
 
for send me all project
 
Are you clear with my problem now?
The log should display SRV, then TRN
but it display TRN for both
but I check in my sqlite, it insert SRV and TRN
 
4:00 PM
yes, I went at home, I will write later, ok?
 
you clear now ?
what time you back ?
just let me know when you back :)
 
 
1 hour later…
5:07 PM
I am here
 
great
Are you clear with my problem now
 
I try
 
thanks
 
o
You had decided your problem?
 
no
the link too complicated
need to call moveToNext?
 
do you may send me your project?
 
but very long
are you ok with it?
 
you may used file sharing
 
5:37 PM
0
Q: How the Spinner setSelection() works?

TonyI have two Spinners in Activity A and they hold these items: {"Pro-XXX-XXX","TRN-XXX-XXX","SRV-XXX-XXX","PRO-REE-BERGARDING","PRO-SKM-SSS","PRO-SKM-DI","PRO-SKM-PACKING","PRO-SIE-AVAGO_S110","PRO-SIE-BIOCON","PRO-BCM-T13/T17"}. Assume that in Spinner1, I select value SRV, and in Spinner2 I sele...

 
like dropbox
 
will it more clear?
my friend post again
 
ya
 
great :)
 
at first - add this function
public int getPosition(Spinner your_spinner, String string_value) {

int position = 0;

for (int i = 0; i < your_spinner.getCount(); i++){
if (your_spinner.getItemAtPosition(i).toString().contentEquals(string_value)) {
position = i;
return position;
}
}
return position;
}
in your UpdatePage2.class
after that
edit your code like this:
if (c != null) {
while (c.moveToNext()) {

Call.Details WD = new Call.Details();

Project11=c.getString(c.getColumnIndexOrThrow(MyDatabaseHelper.Project));
Project22=c.getString(c.getColumnIndexOrThrow(MyDatabaseHelper.Project));
String Project33=c.getString(c.getColumnIndexOrThrow(MyDatabaseHelper.Project));
String Project44=c.getString(c.getColumnIndexOrThrow(MyDatabaseHelper.Project));
addProject1(Project11);
addProject2(Project22);
addProject3(Project33);
addProject4(Project44);
WD.setProject(Project11);
try, and write me result, what selected on project1 and project2
 
5:44 PM
What should write in (Spinner your_spinner, String string_value)
 
stay as like that)
you got error?
 
not yet try
trying
no luck :(
 
how work at this moment?
what item is selected?
 
same problem
spinner 1 and 2 display same item
they display the item selected by spinner 3
sorry, is 2
isn't i need to move the setProject to the last?
 
6:00 PM
that item? TRN-XXX-XXX
 
if spinner 2 select TRN, both will display TRN
depends
 
it is becouse your value Project22 = Project11
it's from your logcat
 
but the item display in spinner also TRN
 
YES!
because
Project11=c.getString(c.getColumnIndexOrThrow(MyDatabaseHelper.Project));
=
Project22=c.getString(c.getColumnIndexOrThrow(MyDatabaseHelper.Project));
What is the difference?
 
how to call if there are in different row but same column
 
6:06 PM
it is another question)
 
same
I don't know how to display the value in the spinner
 
you have skype?
you may show me you screen
 
only facebook
 
what your native language?
 
chinese
 
6:07 PM
ok
 
you have fb?
 
in Project11 and Project22 must be different values?
I have
 
can give ?
0
A: How the Spinner setSelection() works?

csengaWhy do you get the same field for different variables? Project11=c.getString(c.getColumnIndexOrThrow(MyDatabaseHelper.Project)); Project22=c.getString(c.getColumnIndexOrThrow(MyDatabaseHelper.Project)); For reading two rows in your case instead of the while loop: Details WD = new Details(); ...

 
but with facebook you dont can show me your screen?
 
but can send image :)
 
6:09 PM
)))
funy)
in Project11 and Project22 must be different values?
 
because I have 4 spinner. Should have different name right
 
I dont know, it is your project)
 
ya
is ok if you don't want to give
I wont bite
 
if you send me all your project, I decide your problem.
 
I try first, if still cannot will let you know
 
6:18 PM
Your question is easy, but I find it difficult to communicate
 
give me your fb )
but it sounds hard for me :(
 
I understand that
therefore I want your proj)
 
accept me
 

last day (14 days later) »