Thanks for previous replies,
I am doing application with widget, my idea is to open a activity when click the widget. i uesed this piece of code to get the activity
try {
WidgetActivity.Widget.onUpdate(context, appWidgetManager, appWidgetIds);
Toast.makeText(context, "Update Widget", Toast.LENGTH_SHORT).show();
} catch (Exception e) {
e.toString();
}
Intent myIntent = new Intent(context, Test.class);
startActivity(myIntent);
but i am getting forceclose error. i am new to widget concept. i am not sure where to put call the start activity method. Pls guide me
Have a look at the documentation for AppWidgets. Specifically the part where
onUpdate()is discussed, as the example shows how to call anActivityfrom the widget.