在Android的TextView中获取Log.i的结果

时间:2015-07-26 12:58:42

标签: android logcat android-logcat

我们如何在TextView中检索并显示我们在LogCat中提供的消息?

Log.i(LOG_TAG, "Layer Direction : " + direction);
Log.i(LOG_TAG, "Layer ShortPD : " + pr);
Log.i(LOG_TAG, "Layer Stack : " + stackL3);
Log.i(LOG_TAG, "Layer Header : " + msgL3);
Log.i(LOG_TAG, "Layer Data : " + strData);
Log.i(LOG_TAG, "Layer BCCH : " + bcchString);

所以,我在LogCat中显示这些消息,现在我想在我的应用程序中的某些TextView中显示这些消息。

2 个答案:

答案 0 :(得分:-1)

只需在布局中找到您的textview并输入

即可
textView.setText( "Layer Direction : " + direction);
... 

答案 1 :(得分:-1)

请参阅此链接。 http://www.tutorialspoint.com/android/android_textview_control.htm

请按以下步骤操作: 1]创建XML以定义textview。 2]在TextView上为设置文本创建活动类。

相关问题