ViewFlipper dentro de Remoteview showNext () y showPrevious () no funciona
Estoy trabajando en un proyecto donde necesito usar la vista de ViewFlipper dentro de Remoteview en la barra de la notificación. Actualmente estoy enfrentando problemas con un showNext () y showPreview (). Pero, por desgracia, showNext () y showPreview () no se llaman cuando llamo al botón. También estoy publicando mi código para su referencia. Por favor, ayúdame donde estoy cometiendo error y corrija si mi pregunta no está clara.
private Notification setCustomViewNotification() { // Creates an explicit intent for an ResultActivity to receive. Intent resultIntent = new Intent(this, ResultActivity.class); // This ensures that the back button follows the recommended convention for the back key. TaskStackBuilder stackBuilder = TaskStackBuilder.create(this); // Adds the back stack for the Intent (but not the Intent itself) stackBuilder.addParentStack(ResultActivity.class); // Adds the Intent that starts the Activity to the top of the stack. stackBuilder.addNextIntent(resultIntent); PendingIntent resultPendingIntent = stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT); // Create remote view and set bigContentView. expandedView = new RemoteViews(this.getPackageName(), R.layout.notification_viewflipper); // expandedView.set(R.id.text_view, "Neat logo!"); expandedView.setOnClickPendingIntent(R.id.img_left,getPendingSelfIntent(MainActivity.this, IMAGE_LEFT)); expandedView.setOnClickPendingIntent(R.id.img_right,getPendingSelfIntent(MainActivity.this, IMAGE_RIGHT)); Notification notification = new NotificationCompat.Builder(this) .setSmallIcon(R.drawable.ic_launcher) .setAutoCancel(true) .setContentIntent(resultPendingIntent) .setContentTitle("Custom View").build(); notification.bigContentView = expandedView; return notification; }
así que cuando se dispara un evento de clic, tengo que cambiar los elementos de ViewFlipper. El siguiente es el código donde me quedé completamente.
- Hacer carrusel con ViewFlipper o ViewPager
- Cómo deslizar imágenes en ViewFlipper o ViewPager
- Romper el texto grande en las páginas en el selector de texto androide o ver flipper
- Android captura todos los eventos de movimiento y los envía a los niños
- ¿Cuándo usar un ViewFlipper o una nueva actividad?
public void onEvent(ViewFlipperClickEvent event){ if(event.getTag().equals(MainActivity.IMAGE_LEFT)){ expandedView.showPrevious(R.id.ViewFlipper01); }else if(event.getTag().equals(MainActivity.IMAGE_RIGHT)){ expandedView.showNext(R.id.ViewFlipper01); } }
Gracias por adelantado
- Cómo cambiar el atributo 'android: autoStart' de ViewFlipper en RemoteViews mediante programación?
- Golpe de Monodroid
- Error de cursor Android: "asegúrese de que el cursor se inicialice correctamente antes de acceder a los datos de él ..."
- Cómo mantener la vista actual en ViewFlipper al cambiar la orientación
- Android: ViewFlipper que restablece mi marquesina TextView
- ¿Volver a calcular ScrollView en diferentes vistas de ViewFlipper?
- Cómo cambiar entre actividades con viewflipper
- ViewFlipper: Receptor no registrado
- ¿Cómo hacer clic en un elemento SimpleCursorAdapter ListFragment en Espresso?
- Recortar el área de ruta seleccionada desde la vista de imagen personalizada