簡體   English   中英

顯示textView而不是toast消息

[英]displaying textView instead of a toast message

我有以下指令在Toast消息中顯示數據庫中的一些信息,但我想要一條顯示信息但在TextView的指令

Toast.makeText(getBaseContext(), marker.getTitle(), Toast.LENGTH_LONG).show();

非常感謝你。

這是我的TextView的聲明:

displayTextViewTitle = (TextView)findViewById(R.id.text_view_title);

嘗試這個 :

        displayTextViewTitle = (TextView)findViewById(R.id.text_view_title);
        displayTextViewTitle.setText(marker.getTitle().toString);

希望這可以幫助。

嘗試

displayTextViewTitle =(TextView)findViewById(R.id.text_view_title); displayTextViewTitle.setText( “” + marker.getTitle());

寫如下:

displayTextViewTitle.setText(marker.getTitle());

使用displayTextViewTitle.setText(marker.getTitle())

試試這個,

displayTextViewTitle.setText( “” + marker.getTitle());

“(..)但我想要一條顯示信息但在TextView中的指令”。

如果要使用TextView,為什么不閱讀TextView 文檔 您可能會找到一種可以滿足您需求的方法。 文檔是你的朋友,學會喜歡它:)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM