Android listview update data when scroll view - android

I have 1 listView, items of listivew about : button translate, text translate.
when i click button translate,text translate success,(save object model). But error no change text had translate when scroll.I want save status click button translate when scroll again, it translate. can you help me? sorry my english.
Code : I remove code. sorry

At first, I want to clarify your issue:
you want tvTipsMessage update with translated text.
your code works when click in btnDrunkenTranslate but when you scroll down then scroll up again, tvTipsMessage display the untranslate text?
If those above is correct, then I think your problem is you aren't save the new translated text to your object model (although you said you do).
Your object model is FSTipModel, and you use item.getText() to get the display text. But from your posted code, I don't find any code update that value.
You may need to apply this:
add FSTipModel mItem; in ViewHolder
in ViewHolder.fillData, add mItem = item;
in onTranslateTipSuccess, replace tvTipsMessage.setText(CommonUtil.getStringData(data.getResult())); by
mItem.setText(data.getResult());
mText = mItem.getText();
tvTipsMessage.setText(CommonUtil.getStringData(mText));
Hope this works.

Related

Special first item for android spinner

I need to make a spinner like on picture below. My question is - how to add arrow(dropdown hint) to right part for first element in spinner. Better if it(I mean arrow but not "Select test") will disappear after user press it
Add in spinner arraylist zero position as "Select Type" and you want to add arrow So,you need to take image view in right side of your spinner,and when you get spinner item selected position is 0 at that time you need to visible imageview and other position hide imagview.
I hope this can help you!
Thank You.

How to Call Button from List view inside fragment layout

Hello i have problem with button not updating,
I had used sample search , when user search any word ,
I had placed star button in right aligned in
I means to say suppose i search something and list view opens and at right star bookmark is there so on click it must show.
You can't get any useful replies without posting your source code.

Textview Click Issue Android

I have a textview as "emy wattson is a student" and I used marquee property for this textview. Now, it is sliding text. Now, I want to know the clicked word. For example, now I can click the all text and when I want to write the clicked text, I see "emy wattson is a student". But I want to know "emy" , "wattson" , "is" ... seperatly. So, how can I click just word???? Please,help me.
Hmmm...I'm not sure how this would be done. Since a TextView is just an instance of a String, the only way(that I know of) to extract specific values and indexes from String is to use indexOf() and subString() methods. What are you trying to do after you've determined which word in the TextView was clicked?

Edit Text which gives suggestions from the list view under it

In my Android app, I have this screen where the top part is a search box kind of thing and below it there is a ListView. Now the requirement is that when a user starts typing something in the search box I have push up items from the list view which match that pattern.
I have thought of using Auto Complete TextView, but that does not help because the items displayed must be in the list view itself where they can be clicked. They just need to be pushed up the list when they match the pattern of text typed in the Search box above.
How to achieve this ?
Please Help.
use addTextChangedListener in EditText to get user interactin with EditText and update the ListVIew using notifyDataSetChanged();. Try to use Handler

Linkify TextView

i have listview and i call intent from the listview onitem selected method
but when i get linkfy textview in my listrow than i am not able to call intent from the onItem selected method.
Any suggestion would be helpful to me.
I'm a little short on detail here, but it sounds like you want your text to look like a link while still using the list view's onListItemSelected method to handle clicking on the link.
I haven't used 'linkify' in a textview before but I suspect it might be overriding the click/touch event that the list would otherwise be using (to act as a link instead).
If you still want it to look like a link while using the onListItemSelected method, you could easily modify the textview's text color to blue instead, though underlining the text might be a bit more difficult to achieve.

Categories

Resources