###タップでブラウザに画面遷移
click
view.setOnItemClickListener() { parent, view, position, id ->
var uri = "https://something"
var intent = Intent(Intent.ACTION_VIEW, Uri.parse(uri))
startActivity(intent)
true
}
###長押しでテキストコピー
longClick
var clipboard: ClipboardManager = applicationContext.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
view.setOnItemLongClickListener() { parent, view, position, id ->
var copyText: String = view.getItemAtPosition(position) as String;
var clipData = ClipData.newPlainText("コピーしたテキスト", copyText)
clipboard.setPrimaryClip(clipData)
var toastText = copyText + " " + "コピーしました"
Toast.makeText(getApplicationContext(), toastText, Toast.LENGTH_SHORT).show();
true
}