Is it an XML problem ? On 19 mar, 01:39, Alaeddine Ghribi <[email protected]> wrote: > Hi, > I don't know why but when tapping the "calculate" button to store the > data calculated, when i goes to the listview the first time it tells > me that there is no data, when i tap again in the button i have all > datas displayed plus the last one! > Here is a video explanation:http://www.4shared.com/video/Tdps8spN/problem.html > And here is the necessary code: > public class Saves extends Activity { > private Context context; > protected String[][] s; > protected String fileDir; > protected Activity activity; > private static AlertDialog alert_reset; > > public void updatelv(Activity activity) { > SharedPreferences preferences = > PreferenceManager.getDefaultSharedPreferences(context); > String fileName = getResources().getString(R.string.fileName); > fileDir = "" + preferences.getString("login", "") + "."+ > preferences.getString("marque", "") + "."; > s = myIO.ReadFilePerLine(getApplicationContext(), > fileDir+fileName); > ListView L = (ListView) findViewById(R.id.lv); > L.setAdapter(new ArrayAdapter<String>(this, > R.layout.list_item, > s[0])); > } > > @Override > public void onCreate(Bundle savedInstanceState) { > super.onCreate(savedInstanceState); > setContentView(R.layout.histo); > context = getApplicationContext(); > activity = this; > final SharedPreferences preferences = PreferenceManager > .getDefaultSharedPreferences(context); > String fileName = getResources().getString(R.string.fileName); > fileDir = "" + preferences.getString("login", "") + "."+ > preferences.getString("marque", "") + "."; > s = myIO.ReadFilePerLine(getApplicationContext(), fileDir + > fileName); > > updatelv(this); > ListView L = (ListView) findViewById(R.id.lv); > L.setTextFilterEnabled(true); > > Thank you for your help.
-- 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

