Android: Unable to instantiate service...can't instantiate class com.stocktickerwidget.AppWidget$UpdateService; no empty constructor
android, constructor, service
Solution
First, delete your constructor, as you inherit a public zero-argument constructor from `Service`.
Then, either make this be a `static` inner class, or make it be a standalone public Java class. You cannot use a regular inner class here, as Android has no way of creating an instance of that inner class.
Problem
Please help. `Android: Unable to instantiate service...can't instantiate class com.stocktickerwidget.AppWidget$UpdateService; no empty constructor` I get the error above, I do not understand why. Thank you ``` public class UpdateService extends Service { public UpdateService() { // } @Override public int onStartCommand(Intent intent, int flags, int startId) { Log.e("", "onStartCommand di AppWidget"); int[] appWidgetIds = intent.getIntArrayExtra("widgetsids"); final int N = appWidgetIds.length; AppWidgetManager manager = AppWidgetManager.getInstance(this); // Perform this loop procedure for each App Widget that belongs to // this provider for (int i = 0; i < N; i++) { int appWidgetId = appWidgetIds[i]; Log.e("", "i=" + Integer.toString(i) + " di " + Integer.toString(N)); RemoteViews view = buildUpdate(getApplicationContext(), appWidgetIds); // Tell the AppWidgetManager to perform an update on the current // app widget manager.updateAppWidget(appWidgetId, view); } return (START_NOT_STICKY); } @Override public IBinder onBind(Intent intent) { // TODO Auto-generated method stub return null; } } ```