I have two problems

1) This one should be easy to spot but it is 10 years since I did any Java and 
I can' tsee what is wring


TempTempstr[4]) is definately set to 1 but  if (TempTempstr[4].equals("1")) { 
in this bit of code doesn't think it is and I have no ide why




CheckBox cb = new CheckBox(v.getContext());

cb.setText(TempTempstr[0] + ", " + TempTempstr[1] + ", " + TempTempstr[2] + ", 
" + TempTempstr[3] + ", " + TempTempstr[4]);

if (TempTempstr[4].equals("1")) {

        cb.setSelected(true);

}







2)  I also that this bit of code. How can I tell id fit is calling the onclick 
as it doesn't appear to be calling 
http://www.pub-rooms.co.uk/vacancies/android_update_vacancies.php



Button Update = new Button(v.getContext());

Update.setText("Update vacancies list");

LinearLayout.addView(Update); 

Update.setOnClickListener(new OnClickListener() {


public void onClick(View v) {


        HttpPost httppost = new 
HttpPost("http://www.pub-rooms.co.uk/vacancies/android_update_vacancies.php";);


        EditText Temp_Username = (EditText)findViewById(R.id.Username);

        String Username = Temp_Username.getText().toString();


        EditText Temp_Password = (EditText)findViewById(R.id.Password);

        String Password = Temp_Password.getText().toString();

        List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2);

        nameValuePairs.add(new BasicNameValuePair("username", Username));

        nameValuePairs.add(new BasicNameValuePair("password", Password));


        try {

                httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));

        } 

        catch (IOException e) {

                result.setText(e.getMessage());

        }


        try {

                HttpResponse response = httpclient.execute(httppost);

            String str = 
inputStreamToString(response.getEntity().getContent()).toString(); 

        } 

        catch (ClientProtocolException e) {

            result.setText(e.getMessage());

        } 

        catch (IOException e) {

            result.setText(e.getMessage()); 


        } 

} 

});







Thanks

Pam






-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to