[android-developers] AutoCompleteTextView API for Global Search like Google

2014-10-07 Thread Krishna Mahadik
Hi Guys,

Recently working with AutoCompleteTextView Android. I was able to develope
program by binding hardcoded ArrayAdapter to AutoCompleteTextView.

I wanted to know whether is there any api which one can use to get google
search like results in AutoCompleteTextView of an Android app.

Thanks,
Krishna

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] AutoCompleteTextView API for Global Search like Google

2014-10-07 Thread Aaa Ass
There is no special Api for autocomplete but u can use Autocamplete text.view.

Krishna Mahadik krishna.maha...@gmail.com wrote:

Hi Guys, 


Recently working with AutoCompleteTextView Android. I was able to develope 
program by binding hardcoded ArrayAdapter to AutoCompleteTextView.


I wanted to know whether is there any api which one can use to get google 
search like results in AutoCompleteTextView of an Android app.


Thanks,

Krishna

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an 
email to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] AutoCompleteTextView for contacts

2014-01-23 Thread Muhammad Rashid
Hi 

I would like to say that I am developing an android SMS app. I am using 
AutoCompleteTextView for contacts suggestions. Here I am using 
SimpleAdapter with three fields name, phoneNumber and phoneType. 

But when I put any text like m, it suggests all contacts with phoneType 
mobile. Same if I put h, it suggests all contacts with phoneType home.

But I want to get only suggestions for name and phoneNumber not phoneType . 

Regards,

Muhammad Rashid

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [android-developers] AutoCompleteTextView for contacts

2014-01-23 Thread TreKing
On Thu, Jan 23, 2014 at 5:54 AM, Muhammad Rashid muhammad.rash...@gmail.com
 wrote:

 But when I put any text like m, it suggests all contacts with phoneType
 mobile. Same if I put h, it suggests all contacts with phoneType home.

 But I want to get only suggestions for name and phoneNumber
 not phoneType .


Without some code or more information, sounds like you're just querying the
wrong column(s) when filtering.

-
TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[android-developers] AutoCompleteTextView behavior

2014-01-14 Thread Gary Blakely


I'm trying to convert an EditText to a AutoCompleteTextView. There is 
another EditText on the same page. When I had two EditText controls, the 
keyboard would say Next while the entry was going on for the fist one and 
then say done for the second one.

After converting the first EditText to an AutoCompleteTextView, the Next 
button would not skip down to what used to be the second EditText. After 
looking around for a solution I found that if I added the following...

android:imeOptions=actionNext

That would solve my problem and it did cause the cursor to skip down to the 
EditText BUT now my onKey event does not get executed!!

public boolean onKey(View v, int keyCode, KeyEvent event)

So, the imeOptions solution causes worst behavior. I want the Next key to 
obviously trigger the onKey event and also migrate the cursor to the 
EditText field.

Actually, I would be happy for the keyboard to just have a Done key on 
the AutoCompleteTextView because I never liked the Next thing anyway. Is 
there anyway of just doing away with this whold Next metaphor and just 
having the keyboard always say Done for all the entry fields on a page? 
Thanks, Gary

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[android-developers] AutoCompleteTextview multi line (not dropdown but textbox)

2013-12-26 Thread Sandeep Armal


I am using one autocomplete. I want to show this autocomplete as a 
multiline. I don't want to show dropdown as a multi line but i want to show 
textbox as a multi line.

I also use multiline attribute in .xml file but it's showing nextline key 
on keyboard and i don't want to use user to press this and go on next line.

*What happening now*

I am typing something in textbox after finishing space it's scrolling 
horizontally. and show all text in one line.

*What i want*

Suppose user typing and after finishing space of textbox then automatically 
cursor will goes on next line so user can see all text at one time without 
scrolling horizontally.

Here is my code.

AutoCompleteTextView
android:id=@+id/txtTags
android:layout_width=fill_parent
android:layout_height=44dip
android:layout_marginLeft=12dip
android:layout_marginRight=12dip
android:background=@drawable/borderforloginedittext
android:gravity=center_vertical
android:hint=eg: Breakfast, spicy, italian 
android:inputType=textPersonName|textImeMultiLine
android:imeOptions=actionSearch
android:paddingLeft=70dp
android:scrollHorizontally=false
android:verticalScrollbarPosition=right
 android:dropDownHeight=fill_parent
android:dropDownWidth=match_parent
android:textColor=#33
android:textColorHint=#99
android:textSize=16sp 
/AutoCompleteTextView

I need impeoption as an actionsearch so user can press search key of 
keyboard.

Please give some reference or hint.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[android-developers] AutoCompleteTextview to have prefix then start suggestion

2013-02-26 Thread djhacktor
m stuck with a problem, not able to add prefix in autocompletetextview 

like 
Call michael or Call back michael
after user type call or call back  it suggest name (from different 
adapter lets say contact ) 

so there will be two adapter one action and other action upon 

here action is : call , call back 
here action upon : michael 

-- 
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] AutoCompleteTextview to have prefix then start suggestion

2013-02-26 Thread Narendra Singh Rathore
It seems, you need *MultiAutoCompleteTextView*, instead of *
AutoCompleteTextView.*

-- 
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] AutoCompleteTextview to have prefix then start suggestion

2013-02-26 Thread djhacktor
nopes MultiAutoCompleteTextView *suggest * from from same adapter multiple 
time but in my case in need action from on adapter and actionable item
 from another adapter 


On Wednesday, 27 February 2013 00:49:54 UTC+5:30, Narendra Singh Rathore 
wrote:

 It seems, you need *MultiAutoCompleteTextView*, instead of *
 AutoCompleteTextView.*


-- 
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] AutoCompleteTextView - hide soft-keyboard on suggestion list scroll

2013-02-21 Thread Chris Georgoulis
I have an AutoCompleteTextView which as usual provides suggestions after a 
user types 3 letters.
I have already implemented OnItemClickListener on the AutoCompleteTextView 
so the soft-keyboard closes after a value is chosen from the list.

However, I also want the soft-keyboard to be hidden once the suggestion 
list is touched in order to be scrolled.
I have tried it by setting an onTouchListener on the TableLayout but the 
soft-keyboard is hidden once I touch anywhere but the list!

Any ideas would be great!


-- 
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] AutoCompleteTextView behaves differently in different versions of android

2012-12-30 Thread Etienne


I am not clear whether this is an issue with different versions of Android, 
or different screen sizes, but I am getting some unpredictable behavior.

I am testing the UI of the dropdown of a MultiAutoCompleteTextView on a Nexus 
S which is onAndroid v4.1.2 and I am testing on a Nexus 4 which is on Android 
v4.2.1.

When I begin to enter text into the MultiAutoCompleteTextView it returns 
some results. I have created a custom view which contains an ImageView to 
the left of a TextView. When the a row is first displayed, the ImageView will 
have a certain height, however once you scroll through the list of results 
and back up to that original row one of two things happens. Either the 
ImageView stays the same dimensions, or the dimensions of the ImageView will 
change. This specific behavior is happening on the Nexus 4, but I cannot 
reproduce this on the Nexus S.

I am loading Bitmaps into ImageViews just like it is done in the developer 
training Loading Large Bitmaps 
Efficientlyhttp://developer.android.com/training/displaying-bitmaps/load-bitmap.html
.

Can anyone point me in the right direction as far as what to look into? Is 
this a screen resolution issue, or does the latest version of Android 
handle this situation differently than previous versions?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] AutoCompleteTextView remove/change color delimiter

2012-08-08 Thread Dmitriy F


Is it possible to remove/change color of the delimiter(it's grey by 
default) in AutoCompleteTextView's popup ? In ListView I get use of the 
delimiter parameter, but I haven't found any similar in 
AutoCompleteTextView.

Thanks.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] AutoCompleteTextView cursor position.

2012-07-30 Thread Lakshman Bana
Hi Everyone,

I'm having a very simple issue i.e. the cursor goes to the front of
the text when item is selected from my ArrayList in emulator.

here is the sample code:

SimpleAdapter sa = new SimpleAdapter(this, myArrayList,
R.layout.contacts, new String[] { name, number }, new int [] {
R.id.name, R.id.num });
myAutoText.setAdapter(sa);
myAutoText.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView parent, View v, int pos, long id) {
String num = myArrayList.get(pos).get(NUM);
myAutoText.dismissDropDown();
myAutoText.setText(num);
myAutoText.performCompletion();
}
}

And still I see cursor is positioned at start of the text in TextBox
and dropdown is shown with selected item.

Minimum API selected is 9.

Thanks in advance.
Lakshman

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] AutoCompleteTextView for RTL in Android

2012-07-14 Thread Z.A Jafari
please help,i desperately need a solution

On 12 July 2012 09:51, Z.A Jafari zjaff...@gmail.com wrote:


 Hi Romain,

 thanks for your feedback.can you provide some e.g. do you mean only
 changing the locale to persian and language of the phone to persian/farsi
 will allow me to trpe in persian and filter the words from the autocomplete
 or what.can you please elaborate. by the way i am using gingerbread version.

 cheers
 zolf

 On 11 July 2012 21:41, Romain Guy romain...@android.com wrote:

 Hi,

 Full RTL support for text is a feature of Android 4.1.


 On Tue, Jul 10, 2012 at 10:21 PM, Z.A Jafari zjaff...@gmail.com wrote:

 Hello there,

 I have an autocomplete textview which is working perfect with english
 but I want to to use it for farsi/persian language.

 Does android support it?. The data in the autocomplete is got from the
 db. Can somebody please help me to make this work?

 please help

 cheers Zolf

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en




 --
 Romain Guy
 Android framework engineer
 romain...@android.com

  --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en




-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] AutoCompleteTextView for RTL in Android

2012-07-11 Thread Z.A Jafari
Hello there,
 
I have an autocomplete textview which is working perfect with english but I 
want to to use it for farsi/persian language. 

Does android support it?. The data in the autocomplete is got from the db. 
Can somebody please help me to make this work?

please help

cheers Zolf

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] AutoCompleteTextView for RTL in Android

2012-07-11 Thread Romain Guy
Hi,

Full RTL support for text is a feature of Android 4.1.


On Tue, Jul 10, 2012 at 10:21 PM, Z.A Jafari zjaff...@gmail.com wrote:

 Hello there,

 I have an autocomplete textview which is working perfect with english but
 I want to to use it for farsi/persian language.

 Does android support it?. The data in the autocomplete is got from the db.
 Can somebody please help me to make this work?

 please help

 cheers Zolf

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en




-- 
Romain Guy
Android framework engineer
romain...@android.com

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] AutoCompleteTextView for RTL in Android

2012-07-11 Thread Z.A Jafari
Hi Romain,

thanks for your feedback.can you provide some e.g. do you mean only
changing the locale to persian and language of the phone to persian/farsi
will allow me to trpe in persian and filter the words from the autocomplete
or what.can you please elaborate. by the way i am using gingerbread version.

cheers
zolf

On 11 July 2012 21:41, Romain Guy romain...@android.com wrote:

 Hi,

 Full RTL support for text is a feature of Android 4.1.


 On Tue, Jul 10, 2012 at 10:21 PM, Z.A Jafari zjaff...@gmail.com wrote:

 Hello there,

 I have an autocomplete textview which is working perfect with english but
 I want to to use it for farsi/persian language.

 Does android support it?. The data in the autocomplete is got from the
 db. Can somebody please help me to make this work?

 please help

 cheers Zolf

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en




 --
 Romain Guy
 Android framework engineer
 romain...@android.com

  --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] AutoCompleteTextView Behavior

2012-06-19 Thread Ghanshyam Bhatt
Hi,
I have posted a question on StackOverflow. Pplease follow it here:
http://stackoverflow.com/questions/11089929/unable-to-understand-behavior-of-autocompletetextview-android
 

I am unable to understand this behavior. Please help.

Thank you.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] AutoCompleteTextView doesn't show dictionary suggestions

2012-03-05 Thread kaciula


I have a custom AutoCompleteTextView where the user can freely enter text 
and whenever the user writes @ I show a dropdown with suggestions of custom 
usernames. Unfortunately, I also need to show the dictionary word 
suggestions above the keyboard and, for some reason, 
AutoCompleteTextViewdoesn't 
show dictionary suggestions, although it inherits from EditText where it 
does show.

So, does anyone know what the problem is and how to fix it? Or should I go 
to a different route to obtain what I want? I see that the Twitter app has 
both autocomplete and dictionary suggestions when composing new Tweet.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] AutoCompleteTextView suggestions select take user to the interface.

2012-01-26 Thread Kenneth Lor
So say i am tring to use the AutoCompleteTextView suggestions to be
able to bring user to the .xml i have created. If you cant understand
please have a look here 
http://stackoverflow.com/questions/8997684/autocompletetextview-or-searchdialog

Here are my codes, i marked errors in comment //

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.AutoCompleteTextView;

public class Search extends Activity
{
public void onCreate(Bundle savedInstanceSate)
{
super.onCreate(savedInstanceSate);
setContentView(R.layout.searchshop);

AutoCompleteTextView autoComplete = (AutoCompleteTextView)
findViewById(R.id.autoCompleteTextView1);
ArrayAdapterString adapter = new ArrayAdapterString(this,
R.layout.list_item, shops);
autoComplete.setAdapter(adapter);
autoComplete.setThreshold(1);
autoComplete.setOnItemClickListener(new OnItemClickListener() {

@Override
public void onItemClick(AdapterView? arg0, View arg1, int
position,
long arg3) {

Intent intent;
int index=999;
for(int i=0;ishops.length;i++)
{
//Cannot refer to a non-final variable autoComplete
inside an inner class defined in a different method

if(shops[i].equals(autoComplete.getText().toString().trim()))
{
index=i;
break;
}
}
switch(index)
{
case 0:
//The constructor Intent(Search, int) is 
undefined
intent=new Intent(Search.this, R.layout.adidas);
startActivity(intent);
setContentView(R.layout.adidas);
break;
case 1:
//The constructor Intent(Search, int) is 
undefined
intent=new Intent(Search.this, R.layout.affin);
startActivity(intent);
setContentView(R.layout.affin);
break;
}
}
});


}
static final String[] shops = new String[]
{
Adidas,  Affin Bank, Alam Art, Al Amin

};
}

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] AutoCompleteTextView with Contacts Directory Problem (Android Honeycomb)

2012-01-20 Thread BVB
Hello Everyone,

I am attempting to add an AutoCompleteTextView to my Android Honeycomb
application. I would like the AutoCompleteTextView to access the
contacts of the primary Google account that is registered on the
device. Specifically, I would it to provide suggestions for e-mail
addresses listed in the Directory (see http://i.imgur.com/kvSNy.jpg
). The GMail application seems to have this exact functionality, but
as far as I know, it is not open source.

I got started by adding the AutoCompleteTextView to my layout and
adding uses-permission
android:name=android.permission.READ_CONTACTS / to the Manifest
file. However, I am not sure how to get the contacts (specifically
those in the Directory) and use their e-mails as suggestions for the
AutoCompleteTextView.

Does anyone have any ideas?

Thank you!

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] AutoCompleteTextView Cursor messing up

2011-09-27 Thread New Developer
Hi I have an AutoCompleteTextView  which uses a CursorAdapter to read 
entries from the database


Funny thing is  If I type  d   I get the list  (dam , dog , drain , 
duck)  which is correct  then
if I type  r  (to now have dr)  I should get   drainbut the drop 
down still shows   damthe first entry from  d
yet If I select  this first drop down entry then the 
AutocompleteTextView  text field  shows   drain

which is correct.


Why does the drop down list not show correctly ?
I have also noticed that If I have more than 12 entries in the drop down 
list  It shows the first 8 then when I scroll it shows the first 8 again

But like above if I select the 14 entry the text field is correct.


Thanks In advance


Here is the CursorAdapter

@Override
public View newView(Context context, Cursor cursor, ViewGroup parent) {
final LinearLayout   ret  = new LinearLayout(context);
final LayoutInflater inflater = LayoutInflater.from(context);

TextView name = (TextView) 
inflater.inflate(android.R.layout.simple_dropdown_item_1line, parent, 
false);

ret.setOrientation(LinearLayout.VERTICAL);
int nameCol   = cursor.getColumnIndex(DBAdapter.KEY_CLIENT_NAME);
name.setText( cursor.getString(nameCol) );
ret.addView(name, new 
LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT , 
LayoutParams.WRAP_CONTENT));

return ret;
}

@Override
public void bindView(View v, Context context, Cursor c) {
int nameCol = c.getColumnIndex(DBAdapter.KEY_CLIENT_NAME);
String name = c.getString(nameCol);

TextView nameText = (TextView) v.findViewById(R.id.invClient);
if (nameText != null) {
nameText.setText(name);
}
}

@Override
public String convertToString(Cursor cur) {
int nameCol   = cur.getColumnIndex(DBAdapter.KEY_CLIENT_NAME);

String name = cur.getString(nameCol);
return name;
}

@Override
public Cursor runQueryOnBackgroundThread(CharSequence constraint) {
StringBuilder buffer = null;

if (constraint != null) {
if ( constraint.equals(*) ) {
return DataB.getClientList();

} else {
buffer = new StringBuilder();
buffer.append(UPPER(name) LIKE ');
buffer.append( constraint.toString().toUpperCase() + 
%'  );

return DataB.getClientList(buffer.toString());
}
}

return DataB.getClientList();
}


public Cursor getClientList() {
  return myDB.query(DATABASE_TABLE_CLIENT, new String[] { 
KEY_CLIENT_NUMB, KEY_CLIENT_NAME }, null, null, null, null, 
KEY_CLIENT_NAME);

}

--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] AutoCompleteTextView data binding problem

2011-09-16 Thread Monzurul Islam Shamim
Hi,

I have following two arrays and I want to bind them to a
AutoCompleteTextView. My problem is when type on the textview it filters the
nameArr and I lost the correct index in the idArr. How do I bind idArr to
the view?

String idArr[] = new String[]{1,2,3};
String nameArr[] =  new String[]{a,b,c};

autoCompleteAdapter = new ArrayAdapterString(this,
android.R.layout.simple_dropdown_item_1line);
autoCompleteAdapter.setNotifyOnChange(true);
autoComplete =
(AutoCompleteTextView)findViewById(R.id.practice_search_text_edit);
autoComplete.setAdapter(autoCompleteAdapter);

for (int i = 0; i  nameArr.length; i++) {
 autoCompleteAdapter.add(nameArr[i]);
}


Thanks.
-Shamim

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] autocompleteTextView

2011-08-01 Thread New Developer

I have an autocompleteTextView  which is linked to an Adapter that  will
search though the database and find items in the database based on the
few characters entered.

However,  is there anyway to double tap the TextView  or  Tap and Hold
and have it display the entire database list ?
almost like a search for  *


thanks in advance

--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] AutoCompleteTextView with restricted input

2011-05-11 Thread delta42
Greetings Androidians,

I would like to have a special control that behaves like an
AutoCompleteTextView but does not allow the user to type any
characters that would not cause the AutoCompleteTextView to bring up
values in its list.

Put another way, I have a list of 400+ states and countries for
the user to choose from, and I don't want to have the user scroll down
400 items to get to Zambia. AutoCompleteTextView is useful because
hitting Z brings up New Zealand, Zambia, Zimbabwe, etc. The problem
with the AutoCompleteTextView is that it also allows for values not in
the list to be typed in, and I would prefer a UI where I can prevent
the user from doing this.

Ideally I would use setThreshold with 0 or 1 and ignore any
keystrokes that would cause the AutoCompleteTextView to not narrow-in
on an entry, but coding this myself explicitly seems tedious and not-
so-elegant.

Is there another control that does what I want, like some kind of
Spinner that accepts keyboard input to zero-in on entries? Or do I
need to do something with AutoCompleteTextView.Validator?


Thanks in advance,
/d42

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] AutoCompleteTextView and a ContentProvider

2011-03-17 Thread mac-systems
Hello,

what would be the best approach to use an ContentProvider and a
AutoCompleteTextView ?
Looks like i have to use the CursorAdapter ?

regards,
Jens

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] AutoCompleteTextView focus problem

2010-11-16 Thread vibhu
Whenever focus is set to AutoCompleteTextView the menu, back and othe
buttons stop working and the focus is always there on it so m not even
able to close the activity

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] AutoCompleteTextView performance

2010-09-23 Thread Mohammad Haque
Hi All,

Has anyone has experience of working on AutoCompleteTextView with
large number of data sets (~3000 - in string array). I'm working on a
application that has used a this view where user can pick a station
name by typing first few characters. But it appears to be very slow
this size of data set. Any idea of improving performance?

Thanks
Mohammad Haque

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] AutoCompleteTextView and Ajax-like request

2010-09-01 Thread Ken
Hello,

I am trying to implement an AutoCompleteTextView backed by HTTP
requests. i.e., the content of the suggestion comes from a web service
and is obtained by a HTTP request (for example, the symbol lookup
field on Google finance).

Here's the code I wrote to initialize the autocomplete field:

final AutoCompleteTextView field =
(AutoCompleteTextView)findViewById(R.id.lookup_input_field);
ListString suggestions = new ArrayListString();
final MyAutoCompleteAdapter adapter = new MyAutoCompleteAdapter(this,
R.layout.auto_complete_dropdown, suggestions);
field.setAdapter(adapter);
field.addTextChangedListener(new TextWatcher() {
public void afterTextChanged(Editable s) {}

public void beforeTextChanged(CharSequence s, int start, int count,
int after) {}

public void onTextChanged(CharSequence s, int start, int before, int
count) {
String newValue = field.getEditableText().toString();
adapter.valueChanged(field, newValue);
}
});

And here's the valueChanged method of the adapter. The suggestion
retrieval is done in a thread to ensure responsive UI.

public void valueChanged(final AutoCompleteTextView view, final String
value) {
final Handler handler = new Handler() {
public void handleMessage(Message msg) {
clear();
ListString suggestions = 
(ListString)msg.obj;
for (String suggestion : suggestions) {
add(suggestion);
}
notifyDataSetChanged();
}
};
new Thread() {
public void run() {
ListString suggestions = 
SearchHelper.search(value);
if (suggestions.size()  0) {
Message msg = new Message();
msg.obj = suggestions;
handler.sendMessage(msg);
}
}
}.start();
}

Here's my problems: a) The suggestion dropdown doesn't always show up
on each keystroke, even though I know the SearchHelper has
successfully requested and returned suggestions based on user input.
b) When I select an item, the onTextChanged seems to be invoked again
and the suggestion dropdown shows up again.

Sorry if someone has discussed this issue but I wasn't able to find
any examples for my scenario.

Thanks!

Ken

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] AutoCompleteTextView

2010-06-24 Thread praveena ankitha
hi all,

I have One AutocompleTextView and I want to make the virtual keyboard
disappear when he hits DONE at the AutocompleTextView. So far, the buttons
NEXT/DONE do nothing at all Unfortunately I found no resources
addressing this problem.

Any suggestions? thanks in advance

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] AutoCompleteTextView DropDown leaves ghost elements in View / IME area

2010-06-24 Thread TheGroove
When typing in an AutoCompleteTextView, when the list shrinks because
the number of matches goes down, the DropDown leaves several ghost
elements on the screen. This only seems to happen when an IME is
visible, and visually, it appears to be limited to the area that shows
the autocomplete suggestions for the input method, so quite possibly
it's happening in what is part of the IME's layout.
This occurs in 2.0.1, 2.1 and 2.2 emulators, and most likely on
devices as well (confirmed at least on Milestone running 2.1-
upgrade1). It _does not_ seem to happen in an 1.6 emulator.

I've posted a bug report here: 
http://code.google.com/p/android/issues/detail?id=9304
(with screenshot)

For now I'm desperate to find a workaround, I can't push this feature
in my app in its current condition.
One idea I thought of is to force the IME to refresh its View,
however, I have no idea how to access that from my code (if it's at
all possible).

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] AutoCompleteTextView with autoText

2010-06-17 Thread creativepragmatic
I am trying to get autoText to work with AutoCompleteTextView. Since
AutoCompleteTextView is a subclass of EditText, it should work but
doesn't. Is this possible?

Thanks in advance for any help,

Orville

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] AutoCompleteTextView with autoText

2010-06-17 Thread Nandan .
hii in this code i m used autocomplete text box to display phone no from
contect list and dialed no. this can help you



phonetext = (AutoCompleteTextView) findViewById(R.id.PhoneText);
ContentResolver content = getContentResolver();
Cursor cursor = content.query(Calls.CONTENT_URI,
PROJECTION, Calls.NUMBER+ like ?, new String[] { %...@% },
Calls.DEFAULT_SORT_ORDER);

  CallsAdapter adapter = new CallsAdapter(this, cursor);
phonetext.setAdapter(adapter);
 String phoneno = (String) getIntent().getCharSequenceExtra(
org.adore.callstring);
phonetext.setText(phoneno);
logotab1 = (ImageView) findViewById(R.id.tab1ImageView);
eventsData = new EventDataSQLHelper(getBaseContext());
logotab1.setImageResource(R.drawable.logso);
SQLiteDatabase db = eventsData.getReadableDatabase();
cursor = db.query(EventDataSQLHelper.TABLE, null, null, null, null,
 null, _id DESC);
 ContentResolver content = getContentResolver();
 Cursor cursor = content.query(Contacts.People.CONTENT_URI,
 PEOPLE_PROJECTION, null, null, Contacts.People.DEFAULT_SORT_ORDER);
tabactivity4.ContactListAdapter adapter = new
tabactivity4.ContactListAdapter(
 this, cursor);
phonetext.setAdapter(adapter);

With regrads
bhavesh


On Thu, Jun 17, 2010 at 10:14 PM, creativepragmatic 
creativepragma...@gmail.com wrote:

 I am trying to get autoText to work with AutoCompleteTextView. Since
 AutoCompleteTextView is a subclass of EditText, it should work but
 doesn't. Is this possible?

 Thanks in advance for any help,

 Orville

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en




-- 
B!-!/-\\/!=$!-!

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] AutoCompleteTextView and SimpleCursorAdapter

2010-06-06 Thread EvgenyV
Hi All,

I'm using AutoCompleteTextView with SimpleCursorAdapter. It works
properly except one issue: I can't get regular list dropdown view.
When performing filtering the lines are narrow. I've tested API Demos
AutoCompelte1 example and got the normal dropdown view when using
ArrayAdapterString.
Is there any standard way  to show normal dropdown view? Please
advise what is wrong or what I've missed there.

Thans a lot,
Evgeny

The source code is following:

@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);

setContentView(R.layout.main);

   MyAdapter adapter = new MyAdapter(this,
android.R.layout.simple_spinner_item, null,
new String[] {name},
new int[] {android.R.id.text1});
AutoCompleteTextView autoCompleteCountry =
(AutoCompleteTextView)findViewById(R.id.txtCountry);
autoCompleteCountry.setAdapter(_adapter);
//
autoCompleteCountry.setDropDownHeight(LayoutParams.FILL_PARENT);
//
adapter.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);
adapter.setStringConversionColumn(1);
}

private class MyAdapter extends SimpleCursorAdapter
{
public MyAdapter(Context context, int layout, Cursor c, String[]
from,int[] to)
{
super(context, layout, c, from, to);
}

@Override
public Cursor runQueryOnBackgroundThread(CharSequence
constraint)
{
if(constraint == null || constraint.length() == 0)
return 
super.runQueryOnBackgroundThread(constraint);


return myB.rawQuery(select country._id _id, 
country.name_en name
from country where name_en like ' +
constraint.toString().replace(', '') + %', null);
}
}
}

?xml version=1.0 encoding=utf-8?
LinearLayout xmlns:android=http://schemas.android.com/apk/res/
android
android:orientation=vertical
android:layout_width=fill_parent
android:layout_height=fill_parent


ScrollView
android:id=@+id/ScrollView01
android:layout_width=fill_parent
android:layout_height=fill_parent
LinearLayout  android:orientation=vertical
android:layout_width=fill_parent
android:layout_height=fill_parent
TextView
android:id=@+id/lblCountry
android:layout_width=fill_parent
android:text=@string/lblCountryFrom
android:layout_height=fill_parent/

AutoCompleteTextView
android:id=@+id/txtCountry
android:layout_width=fill_parent
android:layout_height=wrap_content
/AutoCompleteTextView
/LinearLayout
/ScrollView
/LinearLayout

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] AutoCompleteTextView static data. Slow performance.

2010-06-02 Thread TreKing
On Tue, Jun 1, 2010 at 7:27 AM, Oleksandr Stashuk
sashko.stas...@gmail.comwrote:

 Is there any way to speed this up?


Don't use such a large list. Try breaking up the one massive list into
something you can index. For example, instead of 1 list of ~2000 items, you
can have 26 lists of about 80 items indexed by the first character in each
address (more if you're using numbers, I guess).

Then when the user starts typing, get the first character they've typed and
get the corresponding list for that character (simple map lookup) and set
that much smaller list as the data source for the auto complete text view.

Disclaimer: I've not done anything with AutoCompleteTextViews so this may or
may not be actually possible =P

-
TreKing - Chicago transit tracking app for Android-powered devices
http://sites.google.com/site/rezmobileapps/treking

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] AutoCompleteTextView static data. Slow performance.

2010-06-01 Thread Oleksandr Stashuk
Hi, all.

I am facing the following problem: I have a big list of street
names(~2000 entries), which is stored as a variable. I have an
AutoCompleteTextView which should complete the names. The process
takes really long time(approx. 2 - 3 seconds) to complete the
suggestion. Is there any way to speed this up? I am pasting my code,
if this is necessary:

AutoCompleteTextView fromInput = (AutoCompleteTextView)
findViewById(R.id.NewOrder_FromInput);
ArrayAdapterString streetsAutocompleteAdapter = new
ArrayAdapterString(
this, R.layout.autocomplete, getStreetsData());
fromInput.setThreshold(3);
fromInput.setAdapter(streetsAutocompleteAdapter);

The getStreetsData() method simply returns the static list of the
names.

Thanks.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] AutoCompleteTextView not working?

2010-05-17 Thread Tommy
Hey everyone,

I have an AutoCompleteTextView and what I would like it to do is to
show up above the text box it is attached to because it gets covered
up by the virtual keyboard when typing. I am trying to set
dropDownVerticalOffset=25px but I get an error: No resource
identifier found for attribute 'dropDownHorizontalOffset' in package
'android' 

Am I missing something?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] AutoCompleteTextView and setText()

2010-05-15 Thread Matthew LeMieux
I found a thread with this subject from about 6 months ago with no resolution, 
so I'll start it up again. 

This is an excerpt from the TextView API: 
public void addTextChangedListener (TextWatcher watcher)

Since: API Level 1
Adds a TextWatcher to the list of those whose methods are called whenever this 
TextView's text changes.
In 1.0, the afterTextChanged(Editable) method was erroneously not called after 
setText(char[], int, int) calls. Now, doingsetText(char[], int, int) if there 
are any text changed listeners forces the buffer type to Editable if it would 
not otherwise be and does call this method.
This seems to make sense for a TextView.  Then, when you look at 
AutoCompleteTextView, I found that it will display the auto complete view every 
time afterTextChanged is called: 

private class MyWatcher implements TextWatcher {
public void afterTextChanged(Editable s) {
doAfterTextChanged();
}
public void beforeTextChanged(CharSequence s, int start, int count, int 
after) {
doBeforeTextChanged();
}
public void onTextChanged(CharSequence s, int start, int before, int 
count) {
}
}

My only choice seems to be to extend AutoCompleteTextView and change the 
behavior.  I am not able to override doAfterTextChanged(), nor am I able to 
keep it from showing up.

The best solution I can find is to override addTextChangedListener, and ignore 
the TextWatcher the AutoCompleteTextView wants to send, and substitute my own 
TextWatcher with a more flexible behavior.  

Any comments?   Is there a much easier solution I've simply missed?

-Matthew

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] AutoCompleteTextView with http datasource

2010-05-12 Thread Ken
Hi,

I have an ajax URL that returns a list of strings based on a partial
search keywrod. Then I try to use this as the data source of an
AutoCompleteTextView. However all the sample code I found so far are
database-related, meaning that I have to deal with a Cursor. Is there
an easier way or do I have to awkwardly create suedo cursors to
accomplish this? Thanks!

Ken

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] AutoCompleteTextView / ArrayAdapter performance

2010-04-25 Thread oriharel
Hi All!
I have an AutoCompleteTextView which the user can enter a name of an
airport.
the suggestion strings looks like this (for example):

John F. Kennedy (JFK)
New York, United States

I'm using an ArrayAdapterString (following the examples in Android
documentation) and when I construct it, I provide a ListString which
have items of the sort of:
airportName (airportCode)/nairportCity, airportCountry

the list size is 4,244.
my problem is that I'm getting a very poor performance from the view.
I'm talking 5-7 seconds after the user entering a letter (I set
threshold to '1').

also my problem is that I want the search to be a regular expression -
i.e., not having the user write the initial letter of the airport name
but any characters sequence that exist in the string. does the view
support that?

thanks!
Ori

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] AutoCompleteTextView weirdness

2010-04-08 Thread Ning
I have an AutoCompleteTextView defined as the following inside a
RelativeLayout,

AutoCompleteTextView android:id=@+id/edit_tag
  android:layout_width=fill_parent
  android:layout_height=wrap_content
  android:hint=@string/tag
  android:inputType=text
  android:imeOptions=actionNext /

When I touch on a choice from the drop down list, instead of setting
the text of this view to the one I chose, it clears the view as if no
text has been inputted.

I tried to debug this and walked through the execution of the program
step by step. It seems to have been cleared at around line 123 in
Looper.java, which I cannot see the source.

Does anyone have any insights?

Thanks.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

To unsubscribe, reply using remove me as the subject.


[android-developers] AutoCompleteTextView with updated suggestions from web?

2010-03-16 Thread Pipen
Is it possible with the AutoCompleteTextView to make the suggestions
get new suggestion values from a webservice? instead of pre populating
it with 100 different strings. Every time the user enters a new
character, i want the AutoCompleteTextView to get new values from a
web service.

please point me in the right direction.

kind regards

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] AutoCompleteTextView and show suggestions

2010-02-26 Thread Steven
Hello,

If I have an EditText, it shows suggestions of words automatically
when typing.  For example, when I start typing Tra, it suggests words
above the keyboard such as travel, training, etc.  However, if I make
the field an AutoCompleteTextView, I can get it to drop down
suggestions of previously entered values like Trader Joe's.

The problem is the suggestions above the keyboard are gone now so it
makes it more difficult to enter longer names, especially with
multiple words.  Any idea on how to get both to work at the same time?

Thanks,
Steve

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] AutoCompleteTextView doesn't work with android:style/Theme.Light

2009-12-15 Thread Jonas Petersson
Hi Romain and Pooper,

Romain Guy wrote:
 This has been fixed since 1.5.

I just stumbled into this one too and I experience the same as Pooper 
even under 2.0.1. So either I'm doing something silly or the fix was not 
correct.

I found a bug filed about a week ago (including source):
http://code.google.com/p/android/issues/detail?id=5237

As far as I can tell, this also occurs when setting Light from the 
manifest - but it works correctly with searchable and similar.

Best / Jonas


 On Sat, Nov 14, 2009 at 5:02 AM, Pooper code...@gmail.com wrote:
 I can't seem to get AutoCompleteTextView to work with Theme.Light

 The problem is the autocomplete popup draws the suggestions text in
 white on a white background.  You can only see what the suggestions
 are after they are selected, because then the white text is drawn over
 top of the selector background.  It works fine with the default theme
 but not with Theme.Light.

 I am using android version 1.5

 My code is pretty much identical to the the Hello AutoCompleteTextView
 sample, except with android:style/Theme.Light and a different String
 array for the suggestions.

 I tried setting the android:textColor attribute.  That only set the
 color for the AutoCompeleteTextView input box, not for the
 suggestion's popup.

 Right now the only way to get my app to work properly is to use the
 default theme.

 Does anyone else have the same issue or know of a way to programically
 set the suggestion's popup text color or background?

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

 
 
 

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] AutoCompleteTextView and setText()

2009-11-28 Thread Klaus Kartou
Hi!

I have a AutoCompleteTextView with a CursorAdapter with data. I need to be
able to set a text in the AutoCompleteTextView programmatically without the
autocomplete mechanism kicking in.
If I use *setText *on the AutoCompleteTextView it will start the
autocomplete.
I tried calling *dismissDropDown() after setText, but this dosnt work
because the drop down is not shown yet.*
**
Any ideas? :D

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] AutoCompleteTextView without Adapter?

2009-11-16 Thread Shirley Cohen
Hi,

I'd like to be able to use auto-completion on a name and address field
without having to specify all the possible names and address values
for these fields. Is there any way to do an auto-complete field
without defining an adapter for it? Another way to ask the question
is, does the SDK come with any predefined value lists that can be used
for this purpose?

Thanks,

Shirley

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] AutoCompleteTextView, passing the focus and Android 1.6

2009-11-15 Thread Armond Avanes
Hi Guys,

Has anyone noticed that AutoCompleteTextView doesn't pass the focus to the
next field when you tap on NEXT button on soft keyboard? And it's all
happening on Android 1.6. v1.5 works flawlessly! Is there any known solution
for this?

Thank you,
Armond

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] AutoCompleteTextView doesn't work with android:style/Theme.Light

2009-11-15 Thread Pooper
I can't seem to get AutoCompleteTextView to work with Theme.Light

The problem is the autocomplete popup draws the suggestions text in
white on a white background.  You can only see what the suggestions
are after they are selected, because then the white text is drawn over
top of the selector background.  It works fine with the default theme
but not with Theme.Light.

I am using android version 1.5

My code is pretty much identical to the the Hello AutoCompleteTextView
sample, except with android:style/Theme.Light and a different String
array for the suggestions.

I tried setting the android:textColor attribute.  That only set the
color for the AutoCompeleteTextView input box, not for the
suggestion's popup.

Right now the only way to get my app to work properly is to use the
default theme.

Does anyone else have the same issue or know of a way to programically
set the suggestion's popup text color or background?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] AutoCompleteTextView doesn't work with android:style/Theme.Light

2009-11-15 Thread Romain Guy
This has been fixed since 1.5.

On Sat, Nov 14, 2009 at 5:02 AM, Pooper code...@gmail.com wrote:
 I can't seem to get AutoCompleteTextView to work with Theme.Light

 The problem is the autocomplete popup draws the suggestions text in
 white on a white background.  You can only see what the suggestions
 are after they are selected, because then the white text is drawn over
 top of the selector background.  It works fine with the default theme
 but not with Theme.Light.

 I am using android version 1.5

 My code is pretty much identical to the the Hello AutoCompleteTextView
 sample, except with android:style/Theme.Light and a different String
 array for the suggestions.

 I tried setting the android:textColor attribute.  That only set the
 color for the AutoCompeleteTextView input box, not for the
 suggestion's popup.

 Right now the only way to get my app to work properly is to use the
 default theme.

 Does anyone else have the same issue or know of a way to programically
 set the suggestion's popup text color or background?

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en




-- 
Romain Guy
Android framework engineer
romain...@android.com

Note: please don't send private questions to me, as I don't have time
to provide private support.  All such questions should be posted on
public forums, where I and others can see and answer them

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] AutoCompleteTextView update from thread problem

2009-11-04 Thread Tim
I've posted this in a couple of places without any help so hopefully
this group has some helpful people :)

I have an AutoCompleteTextView which I want to populate with artist
names based on what the user types.

The problem is that I have a thread for retrieving the names from
a web service, but when I try and update the ArrayAdapter with a
Handler on the
UI thread (which is called from the web service thread), nothing gets
updated on screen.
When I type another letter though, then the previous results from web
service are displayed in the autocompletetextview rather than the
latest.

1) Type 'abc'
2) Web Service gets 'abc1', 'abc2' and 'abc3' and calls Handler to
notify GUI thread
3) Set 'abc1', 'abc2' and 'abc3' on adapter using adapter.add(str)
4) Call notifyDataSetChanged()
5) Nothing changes on GUI :(
6) Type another letter so textview reads 'abc1'
7) Web Service retrieves 'abc1x', 'abc1y' and 'abc1z' and calls
Handler to notify GUI thread
8) Set 'abc1x', 'abc1y' and 'abc1z' results on the adapter
9) Call notifyDataSetChanged()
10) GUI now shows 'abc1' (From step 3)








Here is my code:

public void onCreate(Bundle savedInstanceState) {
...
AutoCompleteTextView actv = (AutoCompleteTextView)
findViewById
(R.id.artist_search_text_edit);
actv.addTextChangedListener(textWatcher);
adapter = new ArrayAdapterString(this,
android.R.layout.simple_dropdown_item_1line, new ArrayListString());
actv.setAdapter(adapter);

}

TextWatcher textWatcher = new TextWatcher() {

@Override
public void onTextChanged(CharSequence s, int start,
int before, int
count) {
Thread t = new Thread() {
public void run() {
ArrayListString names =
(ArrayListString) getArtistStrings
(getInput());
artistNames = names;
messageHandler.sendEmptyMessage
(0);
}
};
t.start();
}

@Override
public void beforeTextChanged(CharSequence s, int
start, int count,
int after) {
}

@Override
public void afterTextChanged(Editable s) {
}
};

private String getInput() {
EditText artistInput = (EditText) findViewById
(R.id.artist_search_text_edit);
String artistSearchString = artistInput.getText
().toString();
return artistSearchString;
}

private void updateTextAdapter(ListString data) {
adapter.clear();
for (String artistName : data) {
adapter.add(artistName);
}
adapter.notifyDataSetChanged();
}

private Handler messageHandler = new Handler() {

@Override
public void handleMessage(Message msg) {
updateTextAdapter(artistNames);
}

};

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] AutoCompleteTextView in an AppWidget?

2009-08-13 Thread moorederodeo

Is it possible to add an AutoCompleteTextView to a widget?
Every time i've tried, it gives me a Problem loading widget error.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] AutoCompleteTextView

2009-08-12 Thread Gavin

all,

   Is there any method to control popup window in
AutoCompleteTextView? Such as location, background...?

  thanks.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] AutoCompleteTextView with SimpleAdapter

2009-08-04 Thread kostmo

Hello,
I am trying to use a SimpleAdapter to populate my
AutoCompleteTextView.  I observe that the Filter runs after the third
keystroke as specified in my layout, and suggestion_list is being
populated with at least five elements.  After the filter runs, the
completionHint drops down from the AutoCompleteTextView, but the there
are no rows underneath (which should contain suggestions).

The underlying datastore is an ArrayList of HashMaps.  The HashMap key
to the value desired in the suggestion rows is vernacular_name.
Since I have specified this in the super() SimpleAdapter constructor,
I assume that it should be calling setViewText with the correct
arguments behind the scenes.

Can anyone see what is wrong with this code, and why the Views
corresponding to suggestions are absent from the AutoCompleteTextView
dropdown?

Thanks,
Karl

public class VernacularAutoComplete extends Activity {

final static String TAG = VernacularAutoComplete;
ArrayListHashMapString, String suggestion_list = new
ArrayListHashMapString, String();

@Override
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);

this.setContentView(R.layout.autocomplete);
SuggestionListAdapter autocomplete_adapter = new
SuggestionListAdapter(
this);

AutoCompleteTextView textView = (AutoCompleteTextView) 
findViewById
(R.id.userText);
textView.setAdapter(autocomplete_adapter);
}

// XXX compiler bug in javac 1.5.0_07-164, we need to implement
Filterable
// to make compilation work
public class SuggestionListAdapter extends SimpleAdapter implements
Filterable {

VernacularFilter vernacular_filter = new VernacularFilter();

public SuggestionListAdapter(Context context) {

super(context, suggestion_list,
android.R.layout.simple_list_item_1,
new String[] { vernacular_name },
new int[] { android.R.id.text1 });
}

class VernacularFilter extends Filter {

@Override
protected FilterResults performFiltering(CharSequence 
constraint) {

FilterResults f = new FilterResults();
if (constraint != null) {
// Log.d(TAG, Running filter...);

ItisMirrorResponseParser imrp = new 
ItisMirrorResponseParser(
(String) constraint);
ArrayListHashMapString, String 
filter_result = imrp
.parse();

f.values = filter_result;
f.count = filter_result.size();
}
return f;
}

@Override
protected void publishResults(CharSequence constraint,
FilterResults results) {

VernacularAutoComplete.this.suggestion_list =
(ArrayListHashMapString, String) results.values;

SuggestionListAdapter.this.notifyDataSetChanged();
}
}

@Override
public Filter getFilter() {
return vernacular_filter;
}
}
}


~~ autocomplete.xml ~~

?xml version=1.0 encoding=utf-8?
LinearLayout xmlns:android=http://schemas.android.com/apk/res/
android
android:orientation=vertical
android:layout_width=fill_parent
android:layout_height=wrap_content


AutoCompleteTextView android:id=@+id/userText
android:layout_width=fill_parent
android:layout_height=wrap_content
android:completionThreshold=3
android:completionHint=Type a name...

/AutoCompleteTextView


/LinearLayout
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] autocompletetextview: get Cursor

2009-07-15 Thread Saurav Mukherjee
hi,
i m using an auto complete text view with a cursor adapter. can anyone tell
me how i can get the reference to the cursor of the record that is selected
from the auto complete list???

thanks in advance.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] AutoCompleteTextView and AdapterView.onItemClickListener with onscreen keyboard not working

2009-05-31 Thread Ty

I have an app that has been working great until I changed the app to
use sensor and tested in 1.5.  When turning the phone sideways with
keyboard closed, I click on the autoCompleteTextView EditText I have
setup.  This brings up the on screen keyboard.  Great.  I start typing
a name and get a dropdown list of say 5 names to select from.  Great.
This dropdown is sideways not vertical.  This is new and I am assuming
this has to do with the onscreen keyboard.  I select one of those
names and it does a callback to my onItemClickListener.  Great.  So
far so good.

Problem is that the View returned is always null.  Always.

If I change the phone back to portrait and do the same all is good and
I can safely rely on the view returned to the listener.

If I leave the phone in landscape but open the physical keyboard then
it works just fine.

Why would the view be null with this new horizontal drop-down?  Is
there a different type of listener I should use.  Should I be setting
something differently in my CursorAdapter?  Any help is much
appreciated.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] AutoCompleteTextView in Eclipse layout editor?

2009-05-28 Thread Chris McCurdy

I'm porting an app of mine to work better with API 1.5, and I'm having
problems with the layout files where I'm using an AutoCompleteTextView
(and, naturally, MultiAutoCompleteTextView). Whenever I have them
present in a layout, the graphical representation of the layout
disappears, and NullPointerException: null replaces it.

Is there any way I can view a widget such as this in the Eclipse
editor? It definitely worked in the 1.1 SDK, otherwise I wouldn't have
used them.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] AutoCompleteTextView in AlertDialog

2009-05-19 Thread skyman

Hello,

Im developing simple public transport navigation app.
There is activity for searching and displaying best connection, which
will be in future launched in many ways (from main Activity, Contacts,
Browser etc.), when there is no Intent data it should open dialog with
AutoCompleteTextView.

But list shown under AutoCompleteTextView is cutted to not to expand
outside of the dialog box. As shown in picture -
http://picasaweb.google.com/lh/photo/hVOqjQ6gOBxmAyZAq5Ft8w?feat=directlink
I know that I can use Activity screen, but Dialog seems to look better
for this action.

Is there any solution for this problem?

Thank's in advance.

Skyman

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] AutocompleteTextView

2009-05-03 Thread 余雷
Hi , all. Can any one give me a example or source code of using
AutocompleteTextView, I met a lot problems of using this view. Thanks.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] AutoCompleteTextView in 1.5 SDK

2009-04-28 Thread Daniel

My app consists of a dialog-style activity with only one
AutoCompleteTextView.
In 1.1 the drop-down list of the AutoCompleteTextView was drawn down
till the bottom of the screen. But now in 1.5, it is only drawn down
to the bottom of the dialog box. So the drop-down list is only a few
pixels
high.
Is this the intended behaviour now?
Why does it work in the Google Search widget?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] AutoCompleteTextView and Theme.Light

2009-04-23 Thread Huebi

Hi, if I use an AutoCompleteTextView and the Theme.Light, I cannot see
the text in the dropdown-box as the font is changed to white and the
background of the dropdown is white as well. Any help on how to change
the font color of the dropdown list?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] AutoCompleteTextView and SimpleCursorAdapter

2009-04-14 Thread ppmoore

Hello,

I am trying to connect a AutoCompleteTextView with a
SimpleCursorAdapter, which narrows down the selection of a list of
words, when the user starts typing.

Following some other posts here, I've come up with the following code,
but it doesn't work. I defined a FilterQueryProvider runQuery() method
for the SimpleCursor Adapter, but when I use the debugger in the code,
the response from the ContentResolver.query((0 method call is null.

I think the problem is that there is no relationship between the
CONTENT_URI and the SQL database, but I can't be sure.

Can someone please help?

Paul

   public static final String AUTHORITY =
com.A.android.examples;
   public static final Uri CONTENT_URI = Uri.parse
(content:// + AUTHORITY +  /sqlautocomplete);

   snip code to fill the SQL Cursor from a list of words
/snip

mContentResolver = this.getContentResolver();
AutoCompleteTextView textView = (AutoCompleteTextView)
findViewById(R.id.edit);

mFrom = new String[] { DictionaryDbAdapter.KEY_ROWID};
mTo = new int[] { android.R.id.text1 };
SimpleCursorAdapter adapter = new SimpleCursorAdapter
( this,

android.R.layout.simple_dropdown_item_1line,
aCursor, mFrom, mTo );

// Define the CursorToString class
adapter.setCursorToStringConverter(new
DictionaryCursorConverter());

// Define the SQL query
adapter.setFilterQueryProvider(new FilterQueryProvider
()
{
@Override
public Cursor runQuery(CharSequence
constraint)
{
  StringBuilder buffer = null;
  String[] args = null;
  if (constraint != null)
  {
buffer = new StringBuilder();
buffer.append(UPPER();
buffer.append(mFrom[0]);
buffer.append() GLOB ?);
String filter = constraint.toString
().toUpperCase() + *;
args = new String[] { filter };
  }

  Cursor aResult = mContentResolver.query
(CONTENT_URI,
   mFrom,
buffer == null ? null :
buffer.toString(), args,
ASC);
  return aResult;
}
} );

// Connect the adapter to the auto-complete text view
textView.setAdapter(adapter);

I implemented the CursorToStringConverter class as follows:

public class DictionaryCursorConverter implements
CursorToStringConverter
{
  @Override
 public CharSequence convertToString(Cursor
theCursor)
 {
   // Return the first column of the database cursor
   String aColumnString = theCursor.getString();
   return aColumnString;
 }
}
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] AutoCompleteTextView for contacts

2009-01-16 Thread Miguel Paraz

Hi,
How can I have a AutoCompleteTextView which autocompletes from the
Contacts, the way the Messaging app does?

It's possible to read the contacts from the Contacts provider, and use
this for the AutoCompleteTextView's adapter. But, how does the
Messaging app show two lines with the contact name and the type of
information (home, mobile, other) in gray?

Thanks!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] AutoCompleteTextView: Need help.

2009-01-15 Thread Don Rules
I have written an application to show the contacts in the
AutoCompleteTextView.
while the user types the alphabets, it fetches the matching contacts to
display.

For this I have used a CursorAdapter

Now I have to get the Contact name when the contact is clicked.

How do i use 
setOnItemSelectedListenerhttp://code.google.com/android/reference/android/widget/AutoCompleteTextView.html#setOnItemSelectedListener%28android.widget.AdapterView.OnItemSelectedListener%29
(AdapterView.OnItemSelectedListenerhttp://code.google.com/android/reference/android/widget/AdapterView.OnItemSelectedListener.htmll)
for the AutoCompleteTextvView.

Please help.

Regards,
Don.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] AutocompleteTextView with cursor

2009-01-06 Thread jphdsn

hi
,
How to use AutoCompleteTextWiew  with a cursor ?

I tried for instance for the cursor addr

contact.addTextChangedListener(this);
contact.setAdapter(new SimpleCursorAdapter
(this,R.layout.selectmail_item,addr,
new String[]
{Contacts.ContactMethods.NAME},new int[]
{R.id.name}));

but all my contacts names are played

If somebody knows how to resolve this kind of problem It will be
fine!!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] AutoCompleteTextView dropdown color

2009-01-04 Thread loty

I have identical AutoCompleteTextView code in 2 different
applications, however one displays dropdown items in nice black text
on white background and the other displays white on white (invisible
unless you highlight the item)

Here is the extract from xml files - I don't do any changes in code
for this control
AutoCompleteTextView
android:id=@+id/data
android:layout_width=180px
android:layout_height=wrap_content/

Please help - I have no idea what would cause this.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] AutoCompleteTextView without keyboard input

2008-11-23 Thread [EMAIL PROTECTED]

Hello,

This is what i am doing, I have a AutoCompleteTextView that filters
the contact names while you type them similar to what the sms app does
right now. In my app I have a virtual keyboard and I need the same
functionality to happen when I type with my VK.

For example, When I open the keyboard I can put in K in this
texfield and I will see a list with names starting with K, but if I
press my k button I do not get anything.

What I am doing is, concatenating strings into this textField, so when
my k button is pressed I add a k to the string that is already
there, my question is how can I have the TextView automatically start
filtering when I press my button, I have looked and do not see
anything that stands out in the API.

Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] AutoCompleteTextView showing filtered results

2008-08-28 Thread sacoskun

Hello,

I am using AutoCompleteTextView with my custom adapter which
implements Filterable.

On the getFilter() method, I am able create a new Filter instance and
override performFiltering() method to find the matched results.
Inside performFiltering all the matched results are added into
FilterResults as values(ArrayListHashMapString, String) and
returned back.

When I move to publishResults() method, I cannot populate the
FilterResults for user and letting him/her pick one fromt the filtered
results.

I try the notifyDataSetChanged() method inside publishResults()
method, but does the dataset change?

I could not find enough documentation on this issue, any help would be
appreciated.

Regards,
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] AutoCompleteTextView - does not display content

2008-07-11 Thread Christian Wiesbauer

Hi,

I have following problem. I’m using an AutoCompleteTextView in my activity. My
problem is that whenever, the view loses focus, it does not display
content in the box. However, when I switch back to AutoCompleteTextView
it starts displaying it.

Does anyone know how to avoid this?

Thanks,
Christian Wiesbauer

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] AutoCompleteTextView Problem - Does not display content

2008-03-31 Thread [EMAIL PROTECTED]

Hi!

Here is the focus change handler I wrote for an AutoCompleteTextView.
Now my problem is that whenever, the view loses focus, it does not
display content in the box. However, when I switch back to
AutoCompleteTextView it starts displaying it. I think this is a wrong
behaviour. Any comments.

Regards
Nitin
HSC

uri_box.setOnFocusChangeListener(new OnFocusChangeListener(){
public void onFocusChanged(View v, boolean hasFocus)
{
if (hasFocus)
{
AutoCompleteTextView uri_box = 
(AutoCompleteTextView)v;
String st = 
uri_box.getText().toString().trim();
if (st.compareToIgnoreCase(Address) == 0)
{
uri_box.setText();
}
}
else
{
AutoCompleteTextView uri_box = 
(AutoCompleteTextView)v;
if 
(uri_box.getText().toString().trim().length() == 0)
{
uri_box.setText(Address);
}
}
}}
);
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---