android-widget

Android task manager or system dialog

社会主义新天地 提交于 2019-12-30 13:49:37
问题 I would like to know is there a way to get events while displaying a System dialog (Such task manager, shut down alert,...). I can close the system dialogs from my activity through intent like below Intent closeDialog = new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS); sendBroadcast(closeDialog); But in my code I need to know a system dialog is shown over the screen (They can be Task manager/ Shut down dialog ...), so that I can invoke the above code for closing it. I searched for intent

Android widget update after x time

和自甴很熟 提交于 2019-12-30 11:09:13
问题 I just started to learn Android, I'm trying to write a widget which is updating the counter in every seconds, but somewhere it's missing something.I'm getting 1 on the screen. I'm using Android 4 emulator. package com.ibluekey; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; import com.ibluekey.R; import android.app.PendingIntent; import android.app.Service; import android.appwidget.AppWidgetManager; import android.appwidget

Android widget update after x time

天涯浪子 提交于 2019-12-30 11:08:04
问题 I just started to learn Android, I'm trying to write a widget which is updating the counter in every seconds, but somewhere it's missing something.I'm getting 1 on the screen. I'm using Android 4 emulator. package com.ibluekey; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; import com.ibluekey.R; import android.app.PendingIntent; import android.app.Service; import android.appwidget.AppWidgetManager; import android.appwidget

Clickable words inside of TextView Android [duplicate]

。_饼干妹妹 提交于 2019-12-30 11:04:51
问题 This question already has answers here : Create clickable link in text view in android (2 answers) Closed 5 years ago . I have a textview that contains hashtags ex. #first #second #third . My question is how can I detect which hashtag is clicked so I can perform some action - eg. make toast of the word. Is this possible using TextView widget? Should I use some other widget istead? UPDATE I found my solution using this example. Hope it will help others in the future! 回答1: You can use spannable

Show SearchWidget in ActionBar if user presses the device's search button

放肆的年华 提交于 2019-12-30 06:20:08
问题 I set up a SearchWidget as described in the Android API Guide. It properly displays a magnifying glass icon in the Action Bar and if I click on it, it launches the search widget within the Action Bar (an input field with dark background). However, if I press the virtual device's search button, then a different search field is launched: It has a white background and does not invoke the callback methods I specified. So I added this to my MainActivity class: public boolean onSearchRequested() {

Android Widget Lifecycle

独自空忆成欢 提交于 2019-12-30 06:17:26
问题 In my widget class that extends extends AppWidgetProvider I have some static final ArrayLists that contain data. I have some buttons in my Widget that when pressed result in onReceive being called within the class. I have noticed sometimes the ArrayLists will have lost their values (be empty) when the onReceive is run but most of the time they have data as expected. Is the ArrayList safe to use in this context? Is there any widget lifecycle events that would cause the list to be re

Android- Multiple Spinners

流过昼夜 提交于 2019-12-30 03:13:27
问题 I have this code: package lijap.app.starcraft2counters; import java.io.File; import android.app.Activity; import android.os.Bundle; import android.os.Environment; import android.view.View; import android.widget.AdapterView; import android.widget.AdapterView.OnItemSelectedListener; import android.widget.ArrayAdapter; import android.widget.Spinner; import android.widget.Toast; public class Settings extends Activity implements OnItemSelectedListener { Spinner answertime; Spinner gametime;

ListView onClickListener() does not work after adding RadioButton

一世执手 提交于 2019-12-30 03:04:53
问题 I have a ListView ( my_list.xml ): <ListView android:id="@+id/my_list" android:layout_width="wrap_content" android:layout_height="wrap_content" android:choiceMode="singleChoice" /> The layout for each list item is ( list_item.xml ): <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="10dp" > <ImageView android

onclick button is not working in listview

不羁的心 提交于 2019-12-29 09:28:10
问题 My project contains listView(homelistView) that contains button(btnList) . When I click on button(btnList) it must go to another Activity. I tried a lot but I didn't find a good example. Please suggest me a good example regarding this. Below is my code: Here is my listview contains button. When on click of button it must go to other activity --------------------------------A-- text text button(btnList) B --------------------------------C--- text text BUTTON(btnList) D ------------------------

Android Widget - Click for action, update under 30 minutes, separate instances

∥☆過路亽.° 提交于 2019-12-29 08:23:33
问题 I've tried to create a widget that, on click calls a routine on Configuration activity, on update calls another routine on Configuration activity, update must be under 30 minutes and all the instance created must work separately (in onUpdate and in onClick). The code below: Click doesn't work (Can't See Toast Message and other function) Update works fine for first instance but with multiple widget instance it works bad: If i create 2 instances between 10 seconds (and refresh is set to 20