0
私はウィジェット(TextView、ImageView ...)のコントロールが異なります。いくつかのコントロールでは、setOnClickPendingIntent(たとえば - tvInfo)を設定しました。それは働く。 TextViewをクリックすると、私のウィジェットがonReceiveになります。ウィジェットをクリックしないでください
protected final void addClickListener(String action, int layoutId) {
Log.d(TAG, "addClickListener " + action);
Intent intent = new Intent(WidgetInfo.Context, getMainWidget());
intent.setAction(action);
PendingIntent actionPendingIntent =
PendingIntent.getBroadcast(WidgetInfo.Context, 0, intent, 0);
remoteViews.setOnClickPendingIntent(layoutId, actionPendingIntent);
しかし、私はtvInfoに再びウィジェットの別の部分をクリックしてください(setOnClickPendingIntentを設定していない場合)および場合。何も起こりませんし、onReceive応答しません。 tvIfoを繰り返しクリックすると、onReceiveが機能します。また、ダブルクリックや偶数回、さらにはtvInfoの場合は、onReceive応答。私がウィジェットの空の部分を奇数回クリックした場合にのみonReceiveは応答しません。