android-widget

How to import the Android App project source code in Eclipse?

情到浓时终转凉″ 提交于 2019-12-07 16:56:00
问题 I downloaded the android source code for callLog UI for the Contacts, Call log, and Dialer applications using this link https://android.googlesource.com/platform/packages/apps/Contacts/ Now, I want to use it on eclipse. But when I try to import the project,it says it didnt found the project. Then I tried to set all the configurations manually, but it show a lot of errors with the importing, the AndroidManifest.xml, with the R.java, etc. So is there any way of import this directly as a project

Is there a way to launch voice input on the softkeyboard programatically?

社会主义新天地 提交于 2019-12-07 16:10:18
问题 The idea is to take a user voice input on the press of a button and pass it to the search inside the app. Because of device limitations we are using the SearchViewCompat instead of the useful SearchView. I have been able to grab the voice output using this link, but there is not a simple way to pass the text to the search bar this way. The search view itself shows as a view (so no setText()), but if I can just say "use mic key on keyboard" or something as soon as the searchbar comes up, I

Spinner with custom adapter doesn't disappear on selection

家住魔仙堡 提交于 2019-12-07 16:06:32
问题 I'm using a Spinner with a custom adapter class called AlgorithmAdapter and in principle everything's working fine, meaning the spinner popup appears and all containing views are properly inflated. However, what I'm not able to find out is how I "tell" the spinner when the selection is made. Of course I know about setSelection() , but that doesn't dispose the popup and return focus to the Activity. So here's some of the relevant code: In my activity, I create my adapter like this:

ExpandabeListView not support ChildClickListener in android

喜夏-厌秋 提交于 2019-12-07 12:16:37
问题 I am using expandable listview to show states of india according to south,north,east,centeral.States list show like that ,but when apply onChildclickListener to expandableListView no response.I want when click state of india a new activity open. expandable listview <ExpandableListView android:id="@+id/indiaParts" android:layout_width="fill_parent" android:layout_height="wrap_content" android:groupIndicator="@null" android:listSelector="@null" android:scrollbars="none" /> list_group.xml <?xml

Keep dialog/activity always on the top

孤街浪徒 提交于 2019-12-07 12:12:26
问题 How to keep a dialog/activity on the top of other activities, no matter if user switch between activities,it should be alive all the time. 回答1: You can use Relative layout as a parent, by using Relative Layout, you can overlap the other layout. So, you have to use to two child layout of relative layout. In the one child you will have popup, and in another layout you have to keep changing your layout.. If you want this across multiple activities. You must create a separate layout and include

Android Appwidget textview not updating

╄→гoц情女王★ 提交于 2019-12-07 11:56:54
问题 Hi im having a very weird problem with my android widget, ive looked extensivly in many places but I cant seem to figure out whats wrong. basically im calling a pendingintent broadcast in my widget and in sucessfully catching that intent in the onrecivie method. However in the onRecive method, when I try to set the text using RemoteViews for my component, the text does not update nor is any error called. I have attached my code below, any help would be great. Thanks, M package com.android

How to set custom list view item's height…?

删除回忆录丶 提交于 2019-12-07 11:30:24
问题 I have a custom list view which contains two text views and on button. I have customized the button style. In the list view each row is not fit to show my button properly. I want to change the list item's height. How can i do that..? This is my list view. <ListView android:layout_width="fill_parent" android:scrollbars="none" android:footerDividersEnabled="false" android:minHeight="50dp" android:listSelector="#00000000" android:dividerHeight="0px" android:divider="#00000000" android:layout

How to add a widget in Android 4.2 emulator?

天大地大妈咪最大 提交于 2019-12-07 06:56:21
问题 I recently downloaded Android SDK and running Android 4.2 on the emulator. However, I don't see any option to add widget on my home screen. (I can't even add default widget). I remember on Android 2.2, a long press on screen would pop up a context menu which will give an option to add a widget. I don't find any option in the new emulator. How to add a widget in Android 4.2 emulator? 回答1: You need to open the applications screen, in it to scroll right until you get to the widgets section. from

Attaching a file of any type in Android application?

与世无争的帅哥 提交于 2019-12-07 06:51:32
问题 I am building an application in which when a user press "Browse" button on the application I want to show folders from phone where user will select the file/image. Once the attachment is selected, application will show the file name in the attachments. What I am looking for is how the file attachment mechanism work in android so any code example or snippet in much appreciated. Thanks in advance. 回答1: What you actually want to do is execute Intent.ACTION_GET_CONTENT. If you specify type to be

Custom view object using up full height of screen even when layout_height is set to wrap_content

寵の児 提交于 2019-12-07 06:47:55
问题 I created an object that extends android.view.View , overriding draw() and have it displaying on the screen. To put you in the picture, it is a display of digits to represent a game score. It's displaying correctly horizontally, however, it is taking up the full height of the screen - pushing all other elements off the screen. I've put layout_height="wrap_content" in the xml, but it has no effect. Does anyone know what I am doing wrong? 回答1: I've figured it out... I was supposed to override