Ma niekto skusenosti s tvorbou widgetov pre android? Mam taky widget kde chcem spustit aktivitu po kliknuti na jeden view:
Kód:
<LinearLayout android:id="@+id/config"
android:paddingLeft="14dp" android:paddingTop="3dp" android:paddingBottom="3dp" android:layout_margin="5dp"
android:layout_alignParentRight="true" android:background="@drawable/config_button"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:clickable="true" android:gravity="center">
<TextView
android:text="..." android:rotation="90" android:textColor="#ffffffff" android:textSize="20sp"
android:layout_width="wrap_content" android:clickable="true" android:gravity="center"
android:layout_height="wrap_content" />
</LinearLayout>
Podla vsetkeho by to malo ist takto, lenze neviem preco sa nic nespusti po kliknuti. Zatial mam toto:
Kód:
Intent intent = new Intent(context, ConfigActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, 0);
RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.ror_appwidget);
views.setOnClickPendingIntent(R.id.config, pendingIntent);
appWidgetManager.updateAppWidget(appWidgetId, views);
Edit: pozmenena otazka