誰想要知道我有下面的代碼添加到我的服務OnStart方法,一旦我添加插件的的onClick是即時可用!
RemoteViews views = new RemoteViews(getApplicationContext().getPackageName(), R.layout.main);
Intent intent1 = new Intent(getApplicationContext(), Config.class);
intent1.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);
intent1.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent1.setData(Uri.parse(intent.toUri(Intent.URI_INTENT_SCHEME)));
PendingIntent pendIntent = PendingIntent.getActivity(getApplicationContext(), appWidgetId, intent1, PendingIntent.FLAG_UPDATE_CURRENT);
views.setOnClickPendingIntent(R.id.imageView2, pendIntent);