| | |
| Stránka: 1 z 1
| [ Príspevok: 1 ] | |
Autor | Správa |
---|
Registrovaný: 11.02.09 Prihlásený: 28.03.23 Príspevky: 2208 Témy: 145 Bydlisko: Liptovský M... |
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
_________________ "Only a warrior chooses pacifism, others are condemned to it." - unknown author |
|
| Stránka: 1 z 1
| [ Príspevok: 1 ] | |
| Nemôžete zakladať nové témy v tomto fóre Nemôžete odpovedať na témy v tomto fóre Nemôžete upravovať svoje príspevky v tomto fóre Nemôžete mazať svoje príspevky v tomto fóre
|
|