Hola amigos, gracias a todos por sus comentarios y por su ayuda.
Hoy la duda es....
porque no me "jala" esta actividad para autocompletar? ya le intente de varias formas pero no realiza la función...
De antemano, agradecido de sus comentarios.
saludos!!!!!
este es mi manifiesto:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="vic.corvic.paquete"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="9" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_ST ORAGE" >
</uses-permission>
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:name=".ventana"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".autocompletar">
</activity>
<activity
android:name=".Result"
android:label="@string/result" >
</activity>
<activity android:name=".DatabaseHelper" >
</activity>
</application>
</manifest>
LA ACTIVIDAD:
package vic.corvic.paquete;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.widget.ArrayAdapter;
import android.widget.AutoCompleteTextView;
import android.widget.TextView;
public class autocompletar extends Activity implements TextWatcher {
TextView selection;
AutoCompleteTextView edit;
String[] items={"argentina", "albania", "alemania", "argelia", "berlin", "bolivia",
"méxico", "brasil", "holanda", "italia", "jamaica"};
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
selection = (TextView)findViewById(R.id.seleccion);
edit = (AutoCompleteTextView)findViewById(R.id.municipio) ;
edit.addTextChangedListener(this);
edit.setAdapter(new ArrayAdapter(this,android.R.layout.simple_dropdown _item_1line,items));
}
public void onTextChanged(CharSequence s, int start, int before,
int count){
selection.setText(edit.getText());
}
public void beforeTextChanged(CharSequence s, int start,
int count, int after){
//
}
public void afterTextChanged(Editable s){
}
}
Y EL XML
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:columnCount="25"
android:orientation="vertical" >
<ScrollView
android:id="@+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="MUNICIPIO"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/seleccion"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<AutoCompleteTextView
android:id="@+id/municipio"
android:layout_width="583dp"
android:layout_height="wrap_content"
android:completionThreshold="3"
android:hint="Municipio..." />
<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/guardar" android:onClick="onAddClick"/>
</LinearLayout>
</ScrollView>
</LinearLayout>