Skip to main content
code formatting
Source Link
ahsteele
  • 26.6k
  • 28
  • 139
  • 256
ArrayList<MyClass> myList = new ArrayList<MyClass>();

ListView listView = (ListView) findViewById(R.id.list);

ArrayAdapter<MyClass> adapter = new ArrayAdapter<MyClass>(this, R.layout.row,
    to, myList.);
listView.setAdapter(adapter);

Class: MyClass

class MyClass {
    public String reason;
    public long long_val;
}

I have created row.xml in layouts, but don't know how to show both reason and long_val in the ListView using ArrayAdapter.

ArrayList<MyClass> myList = new ArrayList<MyClass>();

ListView listView = (ListView) findViewById(R.id.list);

ArrayAdapter<MyClass> adapter = new ArrayAdapter<MyClass>(this, R.layout.row, to, myList.);
listView.setAdapter(adapter);

Class: MyClass

class MyClass {
 public String reason;
 public long long_val;
}

I have created row.xml in layouts, but don't know how to show both reason and long_val in the ListView using ArrayAdapter.

ArrayList<MyClass> myList = new ArrayList<MyClass>();

ListView listView = (ListView) findViewById(R.id.list);

ArrayAdapter<MyClass> adapter = new ArrayAdapter<MyClass>(this, R.layout.row,
    to, myList.);
listView.setAdapter(adapter);

Class: MyClass

class MyClass {
    public String reason;
    public long long_val;
}

I have created row.xml in layouts, but don't know how to show both reason and long_val in the ListView using ArrayAdapter.

ArrayList myList = new ArrayList();

ArrayList<MyClass> myList = new ArrayList<MyClass>();

ListView listView = (ListView) findViewById(R.id.list);

ArrayAdapter<MyClass> adapter = new ArrayAdapter<MyClass>(this, R.layout.row, to, myList.);
listView.setAdapter(adapter);

Class: MyClass

class MyClass {
 public String reason;
 public long long_val;
}

I want to show this in listView. I have created row.xml in layouts, but don't know how to show both Stringreason and long.converted into toString()long_val in the ListView using ArrayAdapter.

Please Help me.

ArrayList myList = new ArrayList();

ListView listView = (ListView) findViewById(R.id.list);

ArrayAdapter<MyClass> adapter = new ArrayAdapter<MyClass>(this, R.layout.row, to, myList.);
listView.setAdapter(adapter);

Class: MyClass

class MyClass {
 public String reason;
 public long long_val;
}

I want to show this in listView. I have created row.xml in layouts, but don't know how to show both String and long.converted into toString() in the ListView using ArrayAdapter.

Please Help me.

ArrayList<MyClass> myList = new ArrayList<MyClass>();

ListView listView = (ListView) findViewById(R.id.list);

ArrayAdapter<MyClass> adapter = new ArrayAdapter<MyClass>(this, R.layout.row, to, myList.);
listView.setAdapter(adapter);

Class: MyClass

class MyClass {
 public String reason;
 public long long_val;
}

I have created row.xml in layouts, but don't know how to show both reason and long_val in the ListView using ArrayAdapter.

edited title
Link
Nikola Smiljanić
  • 26.9k
  • 6
  • 53
  • 62

How to use arrayadapter<myClass>ArrayAdapter<myClass>

Source Link
Sumit M Asok
  • 3k
  • 7
  • 30
  • 38
Loading