无法使用远程视图在通知中添加列表视图,是否有其他方法可以在通知栏中显示列表视图作为通知。无法在远程视图中添加listview,提前致谢....
Notification.Builder mNotifyBuilder = new Notification.Builder(context);
foregroundNote = mNotifyBuilder.setContentTitle("Call is in progres")
.setContentText("Slide down on note to expand").setContent(bigView).setSmallIcon(R.drawable.presence_sb_pending).setWhen(when).build();
NotificationManager mNotifyManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
ArrayAdapter adapter = new ArrayAdapter<String>(context,
R.layout.notification, countryArray);
ListView listView = (ListView)(DroidApiManager.getInstance().getApplicationActivity()).findViewById(R.id.country_list);
listView.setAdapter(adapter);
RemoteViews historylistView = new RemoteViews(context.getPackageName(),R.layout.history_list);
historylistView.setTextViewText(R.id.callType, listView.toString());
foregroundNote.bigContentView = historylistView;
mNotifyManager.notify(1, foregroundNote);