Mgamerz icon

Untitled

Mgamerz | PRO | 08/18/11 11:52:16 PM UTC | 0 ⭐ | 210 👁️ | Never ⏰ | []
Java |

760 B

|

None

|

0 👍

/

0 👎

public class TestDialog extends Dialog {
private ListView menu;
final String[] items = {"Favorite Stops", "Show Bus Lines", "About","Contact"};
    public TestDialog(Context context) {
        super(context);
        requestWindowFeature(Window.FEATURE_NO_TITLE); //Hide the title
        MySimpleArrayAdapter adapter = new MySimpleArrayAdapter(context, items);
        this.setContentView(R.layout.dialog);
        menu=(ListView)findViewById(R.id.ListView01);
        // By using setAdpater method in listview we an add string array in list.
        menu.setAdapter(adapter);
        
        menu.setOnItemClickListener(new OnItemClickListener()
        {
            public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
                    long arg3) {
                Log.e("sys","Hello from ListView");
            }
        });
        
        
        }
    
}

Comments