Android通知TextView字幕不起作用?

Android通知TextView字幕不起作用?,android,textview,android-notifications,marquee,remoteview,Android,Textview,Android Notifications,Marquee,Remoteview,我正在尝试创建自定义通知状态栏,如三星Galaxy S3股票音乐播放器。我正在使用RemoteView进行自定义布局。但是我的textview组件在选框模式下不工作 我的密码在下面。我哪里出错了?我花了很多时间来解决这个问题,但我运气不好 三星Galaxy S3股票音乐播放器通知栏: 这是我的xml布局代码: 这是我的java代码: 私人无效通知 { final NotificationManager NotificationManager=NotificationManager getSyst

我正在尝试创建自定义通知状态栏,如三星Galaxy S3股票音乐播放器。我正在使用RemoteView进行自定义布局。但是我的textview组件在选框模式下不工作

我的密码在下面。我哪里出错了?我花了很多时间来解决这个问题,但我运气不好

三星Galaxy S3股票音乐播放器通知栏:

这是我的xml布局代码:

这是我的java代码:

私人无效通知 { final NotificationManager NotificationManager=NotificationManager getSystemServiceContext.NOTIFICATION\u服务; 悬而未决的微微内容=。。。; 悬而未决的前文=。。。; 悬垂性piPausePlay=。。。; PendingEvent piNext=。。。; NotificationCompat.Builder=新建NotificationCompat.Builder此 .setSmallIconR.drawable.ic_发射器 .setAutoCancelfalse .SetTicker这是股票代码文本 .setContentTitlegetStringR.string.app_名称 .SetContentText这是内容文本 .setContentIntentpiContent; RemoteViews RemoteViews=新的RemoteViewsgetPackageName,R.layout.notification_bar; remoteViews.setTextViewTextR.id.textViewNotifPlaylist,示例播放列表; remoteViews.setTextViewTextR.id.TextViewNotifiItem,这是长文本,我想在选框模式下使用它; remoteViews.setOnClickPendingEventr.id.imgBtnNotifPrevious,piPrevious; remoteViews.setOnClickPendingEventr.id.imgbtnotifPlayPause,piPausePlay; remoteViews.setOnClickPendingEventr.id.imgbtnotifnext,piNext; builder.setContentRemoteView; notificationManager.notifyR.string.app_name,builder.build; }
Marquee需要textview获得焦点,因此您可以像这样重载textview:

public class MarqueeTextView extends TextView {  

public MarqueeTextView(Context appCon) {  
    super(appCon);  
}  

public MarqueeTextView(Context context, AttributeSet attrs) {  
    super(context, attrs);  
}  

public MarqueeTextView(Context context, AttributeSet attrs, int defStyle) {  
    super(context, attrs, defStyle);  
}  

@Override  
public boolean isFocused() {  
    return true;  
}  

@Override  
protected void onFocusChanged(boolean focused, int direction,  
        Rect previouslyFocusedRect) {  
}  

}

但RemoteView不允许自定义文本视图。它给出了RemoteViewsException错误。您解决了上述问题吗?