我正在尝试在文本视图中显示网址路径并在屏幕上显示它。但由于某种原因,它没有显示。我认为我的代码是正确的。
我正在获取网址并转换为字符串(这是在服务中):
String path = ((PlaylistFile)playlistItems.get(currentPlaylistltemNumber)).getFilePath();
Log.d(TAG, "got the path");
//String[] path2 = path.split("/");
Log.d(TAG, "split the path");
artistInfoBOJ = path;
Log.d(TAG, "set to artist info boj");
然后我在另一个类中创建我的文本视图并将其链接到文本:
//artist info stuff
this.textView = (TextView)findViewById(R.id.artistViewBOJ);
Log.d(TAG,"create the text view");
//textView.setMarqueeRepeatLimit(-1);
test = BOJAudioService.artistInfoBOJ;
Log.d(TAG, "set test = to string");
textView.setText(test);
Log.d(TAG,"set text to text view");
我的日志猫中出现了什么:
08-04 12:22:44.574: DEBUG/BOJAudioActivity(17287): create the text view
08-04 12:22:44.574: DEBUG/BOJAudioActivity(17287): set test = to string
08-04 12:22:44.574: DEBUG/BOJAudioActivity(17287): set text to text view
08-04 12:22:44.655: WARN/KeyboardStateImpl(253): EditorInfo provided is null or not valid, defaulting to dumb mode!
08-04 12:22:45.104: DEBUG/dalvikvm(17287): GC_CONCURRENT freed 95K, 50% free 2850K/5639K, external 2569K/2982K, paused 25ms+5ms
08-04 12:22:45.574: DEBUG/BOJAudioService(17287): got the path
08-04 12:22:45.574: DEBUG/BOJAudioService(17287): split the path
08-04 12:22:45.574: DEBUG/BOJAudioService(17287): set to artist info boj
任何想法都可能出错?
答案 0 :(得分:1)
更改
Log.d(TAG, "set test = to string");
到
Log.d(TAG, "set test = to " + test);
看看测试是什么