android-widget

Selecting the currently selected item in a spinner

笑着哭i 提交于 2019-12-10 21:36:19
问题 I have a spinner widget that only has one item by default, "Create new..." My problem is if there is only one item in the spinner list, it's already selected, so clicking on it again doesn't trigger anything. Is there any way to detect when an item is re-selected? Thanks. 来源: https://stackoverflow.com/questions/5201197/selecting-the-currently-selected-item-in-a-spinner

Removing default search icon from SearchView widget

删除回忆录丶 提交于 2019-12-10 21:16:44
问题 How can i remove default search icon which appears as a hint in SearchView widget(not in actionbar)?Through styles i can change the icon but i can't find a way to remove it? 回答1: It's Worked...... ImageView searchViewIcon = (ImageView)searchView.findViewById(android.support.v7.appcompat.R.id.search_mag_icon); ViewGroup linearLayoutSearchView =(ViewGroup) searchViewIcon.getParent(); linearLayoutSearchView.removeView(searchViewIcon); 回答2: For me it only worked this: ImageView magImage =

Contact List with Contact Photo creates performance issue

本小妞迷上赌 提交于 2019-12-10 21:08:58
问题 I am fetching Contact Data using cursor and trying to load it in a ListView I have developed my code based on QuickContact sample of APIDemos (API Level 8) and here is my code which i have modified a bit , but i am facing the performance issue if i remove the contact photo code then performance will be fine otherwise its too slow like dragging a list Adapter Code private class ContactListAdapter extends ResourceCursorAdapter{ Cursor cur; public ContactListAdapter(Context context, int layout,

Need to create spreadsheet like control, what should I extend ListView or GridView?

不想你离开。 提交于 2019-12-10 20:26:06
问题 I am an experienced developer, but I'm inexperienced on the Android platform. So I am seeking some advice from developers with more experience with Android. I am building a Honeycomb application using Fragments. One of the fragments calls for a vertically scroll-able read-only "HTML table-like" view with dynamically loaded data. Similar to a spreadsheet, I should have clickable headers which I can implement server-side requests to filter/sort the data. I am pretty sure this Control doesn't

Widget Not showing up after phone restart

蓝咒 提交于 2019-12-10 20:10:58
问题 I created a widget that works great until I restart the phone, then the widget doesn't display it is invisible but if i hold and click i can throw it in the garbage I have a function that is called from my configure activity in my widgetprovider that does the following: static void updateAppWidget(Context context, AppWidgetManager appWidgetManager, int appWidgetId, int version) { if(savedType == -1) savedType = version; // android.os.Debug.waitForDebugger(); RemoteViews views = new

Add Android Widget on App Install

风流意气都作罢 提交于 2019-12-10 19:35:20
问题 I'm trying to find a way to automatically add a widget without making the user add it manually via the launcher to the home page or lock screen (preferably both, but at minimum to the lock screen). Here's what I have to add the widget to the home screen. What am I missing? public class MyWidgetProvider extends AppWidgetProvider { private static final String ACTION_CLICK = "ACTION_CLICK"; @Override public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {

Attached audio file as a mms in android

最后都变了- 提交于 2019-12-10 19:11:04
问题 I am develop one app that require record the voice.and that voice can be automatically attached to the mms. i am useing this code Intent sendIntent = new Intent(Intent.ACTION_SEND); sendIntent.setClassName("com.android.mms", "com.android.mms.ui.ComposeMessageActivity"); sendIntent.putExtra("address", "9999999999"); sendIntent.putExtra("sms_body", "if you are sending text"); final File file1 = new File(Environment.getExternalStorageDirectory().getAbsolutePath(),"connection.amr"); Uri uri = Uri

How do i implement select and highlight text in android

流过昼夜 提交于 2019-12-10 18:57:15
问题 I am working on eBook reader app and I need to implement select and highlight feature like implemented in Amazon-kindle, kobo,moon+ reader etc. I tried with WebView as we can select text in 2.3 and later versions of android OS on long touch event. I am not getting the window.getSelection() object so my JavaScript is not highlighting the text. This is possible, as other apps have implemented this feature. Does anyone know how to do this? Is there a special API I need to use? 回答1: Have a look

super.onUpdate() in AppWidgetProvider recommend?

和自甴很熟 提交于 2019-12-10 18:22:35
问题 I'm trying to figure out if calling super.onUpdate() is recommend when developing an AppWidgetProvider. public class MyAppWidgetProvider extends AppWidgetProvider { @Override public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) { super.onUpdate(context, appWidgetManager, appWidgetIds); // My code starts here ... } } I'm wondering because it is necessary to call super.onCreate() when developing an Activity. But I can't find anything similar in the

how to perform widget update by service after clicking a button?

送分小仙女□ 提交于 2019-12-10 17:43:29
问题 This is my Configure activity when I try to deploy the widget initially. public class WeatherAppWidgetConfigure extends PreferenceActivity{ private List<WeatherForecast> weatherData = new ArrayList<WeatherForecast>(); private String city_url; private String city_key; OnSharedPreferenceChangeListener listener; int mAppWidgetId; WeatherForecast wfObj; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Set the result to CANCELED. This will cause