Note that there are some explanatory texts on larger screens.

plurals
  1. PODisplaying list of employees in listview
    primarykey
    data
    text
    <h2>Displaying list of employees in listview using arrayList</h2> <ul> <li><strong>list of employees</strong> :: sam, max, carl</li> <li>what code must be added (changes to be made) for <code>MainActivity.java</code> to achive the functionalityusing bean class <code>employee.java</code></li> </ul> <p><strong>row.xml</strong></p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;TextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/textView1" android:layout_width="fill_parent" android:layout_height="fill_parent" android:text="TextView" /&gt; </code></pre> <p><strong>Employee.java</strong></p> <pre><code>import java.io.Serializable; public class Employee implements Serializable{ private String Name; public void SetName(String name){ this.Name=name; } public String GetName(){ return Name; } } </code></pre> <p><strong>activity_main.xml</strong></p> <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill_parent" android:layout_height="fill_parent" &gt; &lt;ListView android:id="@+id/listView-ID" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" &gt; &lt;/ListView&gt; &lt;/LinearLayout&gt; </code></pre> <p><strong>MainActivity.java</strong></p> <pre><code>import java.util.ArrayList; import android.os.Bundle; import android.app.Activity; import android.view.Menu; import android.widget.TextView; public class MainActivity extends Activity { ArrayList&lt;Employee&gt; AL=new ArrayList&lt;Employee&gt;(); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); TextView TV1=(TextView) findViewById(R.id.textView1); } } </code></pre> <p><strong>Thanks</strong>,</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload