-1

In my application i want to stream video. In case if mobile can not play that video VideoView shows dilogue like this what i want if to customize this dialogue and insert two buttons one to download this video and one to try to play an Low Quality video. right now in onErrorLitener of VideoView i am showing dialogue to user but in this way with my dialogue VideoView own dialogue also show on screen which i don't want.

If i cant customize VideoView Error dialogue can i make it dont show on screen

enter image description here

4

2 回答 2

0

我通过将您的代码放入 MediaPlay.setOnErrorListener() 解决了我的问题@AkashG

AlertDialog.Builder builder=new Builder(YourActivityName.this);
        builder.setTitle("Video");
        builder.setMessage("Message you want to pass");
        builder.setPositiveButton("Download", new DialogInterface.OnClickListener() {

            public void onClick(DialogInterface dialog, int which) {
                // TODO Auto-generated method stub

            }
        });
        builder.setNegativeButton("Play", new DialogInterface.OnClickListener() {

            public void onClick(DialogInterface dialog, int which) {
                // TODO Auto-generated method stub

            }
        });
        builder.create();
        builder.show();
于 2012-07-10T09:25:23.007 回答
0
        AlertDialog.Builder builder=new Builder(YourActivityName.this);
        builder.setTitle("Video");
        builder.setMessage("Message you want to pass");
        builder.setPositiveButton("Download", new DialogInterface.OnClickListener() {

            public void onClick(DialogInterface dialog, int which) {
                // TODO Auto-generated method stub

            }
        });
        builder.setNegativeButton("Play", new DialogInterface.OnClickListener() {

            public void onClick(DialogInterface dialog, int which) {
                // TODO Auto-generated method stub

            }
        });
        builder.create();
        builder.show();

只需编写您想在下载/播放按钮单击时执行的代码。

于 2012-07-10T05:40:05.917 回答