开发者

ArrayAdapter alternative

开发者 https://www.devze.com 2023-02-18 05:52 出处:网络
I\'m finding a displaying problem in my app and one of the users开发者_高级运维 advices me to not use ArrayAdapter... i\'m wondering if i can\'t use other thing...

I'm finding a displaying problem in my app and one of the users开发者_高级运维 advices me to not use ArrayAdapter... i'm wondering if i can't use other thing... here is my function that i have to use an ArrayAdapter on it:

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]));
    }

And this is the data that i want to store whenever i tap on a button:

data = date + " : " + y + "L/100KM\n"+ " " + value1 + "L "+ value2 + "KM\n";

Thank you for your help :).

0

精彩评论

暂无评论...
验证码 换一张
取 消