android-widget

AutoCompleteTextView displays 'android.database.sqlite.SQLiteCursor@'… after making selection

杀马特。学长 韩版系。学妹 提交于 2019-12-03 17:26:50
问题 I am using the following code to set the adapter (SimpleCursorAdapter) for an AutoCompleteTextView mComment = (AutoCompleteTextView) findViewById(R.id.comment); Cursor cComments = myAdapter.getDistinctComments(); scaComments = new SimpleCursorAdapter(this,R.layout.auto_complete_item,cComments,new String[] {DBAdapter.KEY_LOG_COMMENT},new int[]{R.id.text1}); mComment.setAdapter(scaComments); auto_complete_item.xml <?xml version="1.0" encoding="utf-8"?> <TextView xmlns:android="http://schemas

GridView in android widgets

爷,独闯天下 提交于 2019-12-03 17:25:26
I have been trying to implement widget for my application with GridView . I am new to Android Development. I have searched a lot on internet but could not find anything helpful. I am kind of stuck here , as this is not showing anything on my GridView . Any help would be appreciated. Thanks in advance ! This is my Code public class MainActivity extends AppWidgetProvider{ public static final String TOAST_ACTION = "com.example.widgetdevelopment.TOAST_ACTION"; public static final String EXTRA_ITEM = "com.example.widgetdevelopment.EXTRA_ITEM"; @Override public void onReceive(Context context, Intent

Multiple widget sizes

China☆狼群 提交于 2019-12-03 17:24:59
I was searching in internet but nothing helps. I want to make second widget, just bigger. Im using service to update my widget so I need to create 2 services (update data in widget by remoteviews etc.) or can I make it easier? When I add medium widget, it shows up te small one but it takes more space (144dp x 72dp) and there is no update. Maybe I should copy whole app classes and modify it, but I think this is stupid solution. I was trying this solutions how to add multiple widgets in one app? How to put multiple widget sizes in one apk? Any hints? :) I had the same need with my widget.

Android soft Keyboard not open in webView`

泪湿孤枕 提交于 2019-12-03 17:24:52
问题 I m Using WebView in AlertDialog to authenticate user to twitter. but When i click on field in webview ,android keyboard doesnt open. here is my code that shows how i added webview in alert dialog. i implicitly call android keyboard but it open keyboard behind alert dialog. here is my code. public static void webViewDialog(final String authorizationURL, final int type) { final boolean correctPin; System.out.println("In webViewDialog"); container = new LinearLayout(context); container

How to create an iOS style arrow button in Android?

送分小仙女□ 提交于 2019-12-03 17:11:26
I am partial to dual use buttons in iOS, like in the image below: How can I create these types of buttons in Android? In other words, the entire button must be clickable, the arrow must be right-aligned and the text of the button must be left aligned. I tried playing with a regular Button widget, but no luck. Do I have to resort to a Table layout (but then the clickability would be lost). Adil Soomro You will need customized shape background for the Button You can find customizing shape here. Set that background to the Button from xml, and for showing arrow, you will need to add arrow.png to

Android: Prevent text field pop-up when entering text in a SearchView

醉酒当歌 提交于 2019-12-03 16:56:12
Hello Android developers, I've got a problem with the Android SearchView widget. What I'm trying to do is to attach a "live" text filter to my ListView (text input automatically refreshes filter results). It works actually fine and it was no huge effort to get it working on my ListActivity with these lines: private SearchView listFilter; this.listFilter = (SearchView) findViewById(R.id.listFilter); this.listFilter.setOnQueryTextListener(this); this.listFilter.setSubmitButtonEnabled(false); this.getListView().setOnItemClickListener(this); this.getListView().setTextFilterEnabled(true); // from

How to set this Layout that fit to Any Screen height?

假装没事ソ 提交于 2019-12-03 16:35:31
I have Some layout Problem regarding my Application. This is My Application Layout: <?xml version="1.0" encoding="utf-8"?> <ImageView android:layout_width="fill_parent" android:layout_height="wrap_content" android:src="@drawable/tax_calculator_logo"/> <LinearLayout android:layout_height="fill_parent" android:layout_width="fill_parent" android:orientation="vertical" android:layout_marginLeft="20dp" android:layout_marginRight="20dp" android:layout_gravity="center" android:layout_marginTop="10dp" android:layout_marginBottom="10dp"> <Button android:id="@+id/contactUs" android:layout_height="wrap

Invoke Flutter (Dart) code from native Android home screen widget

为君一笑 提交于 2019-12-03 16:23:08
问题 I added a native Android home screen widget to my Flutter application. In my AppWidgetProvider implementation, I'd like to call dart code in my onUpdate() method using a platform channel. Is this possible? If so, how can this be achieved? My current Android (Java) code: package com.westy92.checkiday; import android.appwidget.AppWidgetManager; import android.appwidget.AppWidgetProvider; import android.content.Context; import android.util.Log; import io.flutter.plugin.common.MethodChannel;

Grid view item not hightlight when press

早过忘川 提交于 2019-12-03 16:05:44
My app has a grid view, By default, Its item does not highlight when I click on it (I don't know why? ). I try to add it a list selector as below, But it does not work too, <GridView android:id="@android:id/list" android:layout_width="fill_parent" android:layout_height="match_parent" android:layout_above="@+id/load_more_process_id" android:layout_alignParentTop="true" android:drawSelectorOnTop="false" android:listSelector="@drawable/grid_selector" > </GridView> Here my selector: <selector xmlns:android="http://schemas.android.com/apk/res/android" > <item android:state_pressed="true" android

Android - Set a border around an ImageView

醉酒当歌 提交于 2019-12-03 15:44:10
问题 I have a cell with a fixed width and height, let it be 100x100px. Inside that cell I want to display an ImageView with a border around. My first idea was to put a background resource to the ImageView , and add a padding of 1dp to create the border effect: <LinearLayout android:layout_width="100dp" android:layout_height="100dp" > <ImageView android:id="@+id/imageView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/image_border" android