Android 数组的setTextIsSelectable(true)

Android 数组的setTextIsSelectable(true),android,Android,在我的android应用程序中,我想启用复制,并且使用setTextIsSelectable(true),它适用于标题,但不适用于列表视图项。列表视图项是数组 titleTextView.setTextIsSelectable(true); 使用上面的代码,我可以复制标题,但我想启用文本复制,它来自一个文本文件,位于listview中 titleTextView = (TextView) findViewById(R.id.titleID); listViewLayout = (Li

在我的android应用程序中,我想启用复制,并且使用setTextIsSelectable(true),它适用于标题,但不适用于列表视图项。列表视图项是数组

     titleTextView.setTextIsSelectable(true);
使用上面的代码,我可以复制标题,但我想启用文本复制,它来自一个文本文件,位于listview中

titleTextView = (TextView) findViewById(R.id.titleID);
listViewLayout = (LinearLayout) findViewById(R.id.ListViewLinearLayout);

titleTextView.setTypeface(font);

dataValues[0] = "";
dataValues[1] = "";

listView = (ListView) findViewById(R.id.listView);
swipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swipe_refresh_layout);

jokesList = new ArrayList<>();
timeDateList = new ArrayList<>();

adapter = new SwipeDownListAdapter(this, jokesList, timeDateList);
listView.setAdapter(adapter);
titleTextView=(TextView)findViewById(R.id.titleID);
listViewLayout=(LinearLayout)findViewById(R.id.ListViewLinearLayout);
titleTextView.setTypeface(字体);
数据值[0]=“”;
数据值[1]=“”;
listView=(listView)findViewById(R.id.listView);
swipeRefreshLayout=(swipeRefreshLayout)findViewById(R.id.swipe\u refresh\u layout);
jokesList=newarraylist();
timeDateList=新的ArrayList();
adapter=新SwipeDownListAdapter(此、jokesList、timeDateList);
setAdapter(适配器);
任何实现目标的想法都是伟大的,。 我试过了,但它出错了 jokesList.setTextIsSelectable(true)

它只给出了一个布尔错误

这是listview数组

男孩:校长真傻!/-%/女孩:你知道我是谁吗?/-%/男孩:不…/-%/女孩:我是校长的女儿!/-%/男孩:你知道我是谁吗?/-%/女孩:不…/-%/男孩:好!走开|周五,下午5:23:04


男孩:打911喂?我需要你的帮助!/-%/911:好吧,那是什么?/-%/男孩:两个女孩在为我打架!/-%/911:那你有什么急事?/-%/男孩:丑八怪赢了。|周五,下午5:36:19


最近的一次™We’今年我的节食计划正在从我的浏览器历史记录中删除食物搜索。//-%//-%/lollzzz:p |周五,下午5:44:35


我的朋友认为他很聪明。他告诉我洋葱是唯一能让你哭的食物,所以我朝他脸上扔了一个椰子



笑话列表
是一个数组列表。为什么你会认为
jokesList.setTextIsSelectable
是一个有效的方法?@cricket\u 007 how to do.plz guide
setTextIsSelectable
只是
TextView
类型的对象的一个方法,这就是为什么它适用于
titleTextView
的原因。我不知道您在
jokesList
中有什么类型的数据,因为您没有添加@cricket\u 007示例不,您只添加了数据,而没有添加如何定义
jokesList
的代码。请阅读该链接并制作完整的示例