Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to change values in second layout in same Activity?
    primarykey
    data
    text
    <p>My scenario is that I have a activity which shows the cursor stored in SQLite DB. The main layout contains textview at top and a listview. And then I use simplecursoradapter to populate cursor into listadapter and put listadapter into listview. simplecursoradapter use another layout. The problem now is that when I use simplecursoradapter I bring three columns into listview, example: item name, date and price. That is ok if I don't change these values.</p> <p>Actually I want to add some string to price and form new string such as currency sign. According to my understanding we only can setContentView for one layout not two layouts. I also tried to populate a new layout and set value but failed</p> <p>LayoutInflater inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); View textEntryView = inflater.inflate(R.layout.itemlist, null); TextView price = (TextView) textEntryView.findViewById(R.id.price); price.setText(currency + c.getString(4).toString());</p> <p>Even there is no problem in syntax and run apps. But when I run the app and check listview, the price still show price only without adding currency sign. I only can add currency sign under the main layout not the second layout used in simplecursoradapter.</p> <p>In fact, currency is chosen in user preference, and I use sharedpreference to retrieve its value and add to price value in cursor. It seems that simplecursoradapter is using different layout, so cannot do that.</p> <p>Does anyone has ideas about this case ?</p> <p>I would be appreciated if methods and codes are provided for similar approach.</p> <p>Thanks !!</p>
    singulars
    1. This table or related slice is empty.
    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.
    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