[英]How to show Toast when I click on the LayoutParams TextView
This is single TextView
which is containing values form database.这是单个
TextView
,其中包含来自数据库的值。 So I want when I click on the TextView,
it should show Toast
the same text in the position I clicked.所以,我想,当我点击
TextView,
它应该显示Toast
在我点击的位置相同的文字。
This is the code the TextView
showing the data which is coming from the firebase.这是
TextView
显示来自 Firebase 的数据的代码。
textView = new TextView(Chat.this);
textView.setText(message);
final Typeface typeface = Typeface.createFromAsset(getAssets(), "fonts/fnt1.otf");
textView.setTypeface(typeface);
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
lp.setMargins(0, 0, 0, 20);
textView.setLayoutParams(lp);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.