when we click the widget at that time i need to open a activity screen(or application).How to do this? Thanks in advance !!
+2
A:
You need to set an onClickpendingIntent on your widget
Intent intent = new Intent(context, ExampleActivity.class);
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, 0);
// Get the layout for the App Widget and attach an on-click listener to the button
RemoteViews views = new RemoteViews(context.getPackageName(),R.layout.appwidget_provider_layout);
views.setOnClickPendingIntent(R.id.button, pendingIntent);
Check this out
http://advback.com/android/working-with-app-widgets-android/
http://stackoverflow.com/questions/2471875/processing-more-than-one-button-click-at-android-widget
Rahul
2010-08-28 06:36:54
A:
The Android developer pages for App Widgets has information and a full example doing exactly this: http://developer.android.com/guide/topics/appwidgets/index.html
totramon
2010-08-28 07:02:01