@Override
public View getView(int position, View convertView, ViewGroup parent) {
 // TODO Auto-generated method stub
if(convertView==null){
if(convertView==null){
convertView = (LinearLayout)layoutInflater.inflate(R.layout.searchlayout, 
null);
TextView tx1 = (TextView)convertView.findViewById(R.id.ccd_textView1);
tx1.setText(data.getCity()); 
TextView tx2 = 
(TextView)convertView.findViewById(R.id.ccd_textViewDetail_1);
tx2.setText(ccd.getTemp_c());
WriteSettings(SWFForeCastInfoLayoutAdapter.this, data.getCity()+" 
"+ccd.getTemp_c());
ImageView im = (ImageView)convertView.findViewById(R.id.imageView1);
im.setImageResource(R.drawable.delete);
} 
} 
return convertView; 
}
private void WriteSettings(
SWFForeCastInfoLayoutAdapter swfForeCastInfoLayoutAdapter,
String data) {
// TODO Auto-generated method stub
 FileOutputStream fOut = null;
         OutputStreamWriter osw = null;
         try {
             fOut = openFileOutput("loc1.txt", MODE_APPEND);
             osw = new OutputStreamWriter(fOut);                             
                                  
             osw.write( data+",");
             osw.flush();
//             Toast.makeText(swfForeCastInfoLayoutAdapter, "Settings 
saved", Toast.LENGTH_LONG)
//                             .show();                       
             }catch(Exception e)
             {
             e.printStackTrace();

//                 Toast.makeText(swfForeCastInfoLayoutAdapter, "Settings 
not saved", Toast.LENGTH_LONG)
//                                 .show();
             }
             finally {

                 try {

                         osw.close();
                         fOut.close();
                 } catch (IOException e) {

                         e.printStackTrace();

                 }

         }
}

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

Reply via email to