I have a requirement to load a list of images into RemoteView's. For that purpose I am using ViewFlipper to show when the user clicks next and previous buttons. But the problem I am facing with ViewFlipper is that I couldn't able to add the images dynamically, whereas I am getting output once if I load the images from drawables locally inside the ViewFlipper. Kindly please help. I couldn't able to find the solution for this with RemoteViews. I am posting my code for your reference as follows:
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
RemoteViews expandedView = new RemoteViews(this.getPackageName(), R.layout.notification_viewflipper);
expandedView.setOnClickPendingIntent(R.id.img_left,getPendingSelfIntent(MainActivity.this, IMAGE_LEFT));
expandedView.setOnClickPendingIntent(R.id.img_right,getPendingSelfIntent(MainActivity.this, IMAGE_RIGHT));
}
protected PendingIntent getPendingSelfIntent(Context context, String action) {
Intent intent = new Intent(context,MyNotificationReceiver.class);
intent.setAction(action);
return PendingIntent.getBroadcast(context, 0, intent, 0);
}
Any sort of tips and hints will be much helpful for me. Thanks in advance.