我正在使用此代码在通知栏中显示通知。点击通知后,将启动主要活动。是否可以使用MvvmCross在Xamarin表单应用程序中启动视图模型而不是活动。
Intent notificationIntent = new Intent(context,typeof(MainActivity));
notificationIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
PendingIntent pIntent = PendingIntent.getActivity(context, code,
notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);
NotificationManager manager = (NotificationManager) context
.getSystemService(Context.NOTIFICATION_SERVICE);
NotificationCompat.Builder notify = new NotificationCompat.Builder(
context);
notify.setContentIntent(pIntent);
notify.setSmallIcon(R.drawable.app_icon);
notify.setContentTitle(“Title”);
manager.notify(reqCode, notify.build());