hello,

i have developed simple widget which display images from sd card. I
have two button(for setting and open)  on center frame. Now i am
calling Activity Class to display User Interface for setting and
display Image in big view. But i am getting RunTimeException if i try
to use PendingIntent for both button. if i set pendingIntent for one
Button then it is working fine.  The following is my code snippet.
 hope to hear soon from you.


  Intent configIntent  = new Intent(context,
ImagesWidgetConfiguration.class);
          configIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID,
appWidgetId);
          //To specify open image action
          configIntent.putExtra("action", "open");
          // gotta make this unique for this appwidgetid
 
configIntent.setData(Uri.withAppendedPath(Uri.parse(URI_SCHEME + "://
widget/id/"), String.valueOf(appWidgetId)));

          PendingIntent pendingIntent1 =
PendingIntent.getActivity(context, 0, configIntent,
PendingIntent.FLAG_UPDATE_CURRENT);
          remoteView.setOnClickPendingIntent(R.id.play_pause,
pendingIntent1);



// For Second        Button
          //remoteView = new RemoteViews(context.getPackageName(),
R.layout.main);
          Intent updateIntent=new
Intent(context,ImagesWidgetConfiguration.class);
          updateIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID,
appWidgetId);

          updateIntent.putExtra("action", "setting");

 
updateIntent.setData(Uri.withAppendedPath(Uri.parse(URI_SCHEME + "://
widget/id/"), String.valueOf(appWidgetId)));

           PendingIntent pendingIntent =
PendingIntent.getActivity(context, 0, updateIntent,
PendingIntent.FLAG_UPDATE_CURRENT);
          remoteView.setOnClickPendingIntent(R.id.next,
pendingIntent);






-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to