从图像/按钮打开一个对话框,单击android中的仪表板 [英] Opening a dialog from an image/button click on dashboard in android

查看:112
本文介绍了从图像/按钮打开一个对话框,单击android中的仪表板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正在开发一个包含六个图像的仪表板的Android应用程序。

我的问题是我可以为每个图像实现对话框

每当用户点击每个图像时它会弹出一个对话框,显示

用户可供选择的选项列表以导航到另一个活动



请参阅下面的仪表板代码

  public   void  onButtonClicker(View v) 

{

意图意图;



switch (v.getId()){

case R.id.btnTest1:

intent = new 意图( this ,VerbalSection1。 class ); // 我想要对话框代码

startActivity(intent);

break ;



case R.id.btnTest2:

intent = new 意图(,CustomRow。 class ); < span class =code-comment> // 我想要对话框代码

startActivity(intent);

break ;



case R.id.btnTest3:

intent = new 意图(,CustomRow。 class ); < span class =code-comment> // 我想要对话框代码

startActivity(intent);

break ;



case R.id.btnTest4:

intent = new 意图(,CustomRow。 class ); < span class =code-comment> // 我想要对话框代码

startActivity(intent);

break ;



case R.id.btnTest5:

intent = new 意图(,CustomRow。 class ); < span class =code-comment> // 我想要对话框代码

startActivity(intent);

break ;



case R.id.btnTest6:

intent = new 意图(,CustomRow。 class ); < span class =code-comment> // 我想要对话框代码

startActivity(intent);

break ;

默认

break ;

}

}



提前感谢您的回复

解决方案

请参阅 http://developer.android.com/guide/topics/ui/ dialogs.html [ ^ ]

Am developing an android app with dashboard containing six images.
My question us is it possible for me to implement dialog for each images
Whenever the user clicks each image it pops up a dialog that shows
the user list of options to choose from to navigate to another activity

See the dashboard code below

public void onButtonClicker(View v)

    {

        Intent intent;



        switch (v.getId()) {

            case R.id.btnTest1:

                intent = new Intent(this, VerbalSection1.class);//I want dialog code here

                startActivity(intent);

                break;



            case R.id.btnTest2:

                intent = new Intent(this, CustomRow.class);//I want dialog code here

                startActivity(intent);

                break;



            case R.id.btnTest3:

                intent = new Intent(this, CustomRow.class);//I want dialog code here

                startActivity(intent);

                break;



            case R.id.btnTest4:

                intent = new Intent(this, CustomRow.class);//I want dialog code here

                startActivity(intent);

                break;



            case R.id.btnTest5:

                intent = new Intent(this, CustomRow.class);//I want dialog code here

                startActivity(intent);

                break;



            case R.id.btnTest6:

                intent = new Intent(this, CustomRow.class);//I want dialog code here

                startActivity(intent);

                break;

            default:

                break;

        }

    }


Thank you in advance and reply soon

解决方案

See http://developer.android.com/guide/topics/ui/dialogs.html[^].


这篇关于从图像/按钮打开一个对话框,单击android中的仪表板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆