片段中加载布局中的按钮 [英] Buttons in loaded layout in a fragment

查看:71
本文介绍了片段中加载布局中的按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

如何编写代码以点击片段中加载的按钮?

片段代码:

 FragmentManager fm = getSupportFragmentManager(); 
android.support.v4.app.FragmentTransaction ft = fm.beginTransaction();
ft.add(R.id.frame,new Directory());
ft.commit();



我想访问点击目录中的按钮!



什么我试过了:



点击一个加载在片段中的按钮

解决方案

< blockquote>请参阅按钮| Android开发者 [ ^ ]

Hello,
How can I write code for clicking on a button that it is loaded in a fragment?
The code for fragment:

FragmentManager fm=getSupportFragmentManager();
       android.support.v4.app.FragmentTransaction ft=fm.beginTransaction();
       ft.add(R.id.frame,new Directory());
       ft.commit();


I want to Access clicking on a button in Directory!

What I have tried:

clicking on a button that it is loaded in a fragment

解决方案

See Button | Android Developers[^].


这篇关于片段中加载布局中的按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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