私はforループを使用してみましたが、一度しか表示されないので、一度にリスト全体が必要です。配列ビューをテキストビューで表示
private void prepareEmergencyAll(JSONArray emergency_all) {
LinearLayout myLayout1 = (LinearLayout)findViewById(R.id.listTL);
ListView emgcyall_list = (ListView)findViewById(R.id.emgcyallLV);
// LinearLayout myLayout2 = (LinearLayout) findViewById(R.id.phonelistTL);
for(int i=0;i<emergency_all.length();i++){
Emergency_all emglist = new Emergency_all();
try {
JSONObject single = emergency_all.getJSONObject(i);
emglist.setFullname(single.getString("fullname"));
emglist.setPhone(single.getString("phone"));
list.add(emglist);
// emgcyall_list.setAdapter(adapter1);
} catch (JSONException e) {
e.printStackTrace();
}
}
adapter1=new EmgcyAdapter(ViewActivity.this,list);
emgcyall_list.setAdapter(adapter1);
// adapter1 = new EmgcyAdapter(,list);
}
:私はリストビューを使用してみましたが、それは行動をスクロールしたときに、私は
この
が私のコードは、リストビューを使用します。.. action.Iが私を助けしなさい時点で配列リストを表示したいスクロールする必要はありません
.. ...リストビューの高さを動的に変更するためのソリューションを持ってここにコードがあります。 –
'TextUtils.join()'メソッドを使用してください。 – chRyNaN
サンプルコードを教えてください。 –