Note that there are some explanatory texts on larger screens.

plurals
  1. POAutocompleteTextView setText or setHint not working
    primarykey
    data
    text
    <p>So in my first activity i'm getting the current location as currentLocation through reverse geocoding and i use <strong>sharedPreference</strong> to pass the value to the next activity (<strong>second.java/class</strong>). This class consist of an autocompleteTextView whose values are stored in an array.</p> <p>Now what i want is when the user goes from the first activity to the second activity the autocompleteTextView should contain the location obtained from the first class as a <strong>hint</strong> or a <strong>Text</strong></p> <p>So this is my <strong>firstclass.java</strong></p> <pre><code>Toast.makeText(this,currentPlace, 1000).show(); //works SharedPreferences preferences = getSharedPreferences("myPrefss", getApplicationContext().MODE_PRIVATE); SharedPreferences.Editor editor = preferences.edit(); editor.putString("CurrentPlace", currentPlace); editor.commit(); </code></pre> <p>and my <strong>secondclass.java</strong></p> <pre><code>SharedPreferences preferences = getSharedPreferences("myPrefss", getApplicationContext().MODE_PRIVATE); SharedPreferences.Editor editor = preferences.edit(); String curlocation; from = (AutoCompleteTextView) findViewById(R.id.et_login_form); curlocation = editor.putString("CurrentPlace",""); from.setText(curlocation); //doesn't work from.setHint(curlocation); //doesn't work </code></pre> <p>and this is my <strong>XML</strong></p> <pre><code> &lt;AutoCompleteTextView android:id="@+id/et_login_form" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="20dp" android:layout_marginRight="20dp" android:layout_marginTop="5dp" android:inputType="textMultiLine" android:textColor="@android:color/black" /&gt; </code></pre> <p>and i've tried setting the text in xml throught </p> <pre><code>android:Text= "sample text" android:Hint= "sample text" </code></pre> <p>which shows up in the graphical view but not in the MobilePhone</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload