views:

101

answers:

2

I have a songs list-view and I want to show pop-up media player when item in list-view clicked. A pop-up is a activity. But I don't know how to show pop-up activity on list-activity.Please can anybody help me ?

A: 

i am working on same requirements.. If i find any solution i will let you know ..

Tareq
A: 

One way is to use an ACTION_VIEW intent to open the video in Android's video player. (If you have other apps installed that can also play video the user will be prompted to choose one, and they can set a default to save being prompted every time.)

So for example, in your ListActivity subclass's onCreate method:

getListView().setOnItemClickListener(new OnItemClickListener() {
    public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
        try {
            Intent in = new Intent(Intent.ACTION_VIEW);
            in.setDataAndType(Uri.parse("http://example.org/video.mp4"), "video/*");
            startActivity(in);
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }
    }
});
Simon Whitaker