adapter

Anyway to pass a constructor parameter to a JAXB Adapter?

时光毁灭记忆、已成空白 提交于 2019-12-12 08:26:55
问题 I'm using Spring 3 IOC and JAXB/JAX-WS in a WebService that I wrote. I am having a slight issue right now with data that must be rounded prior to returning to the consumer as they are not capable of handling the complete precision of the values. To minimize the impact on the WS design and calculations, I chose to use an Jaxb XmlAdapter to round the values upon marshalling of my response. Everything works fine. My issue now is that I would like to make it flexible. Ie: in some cases, I need to

Listview fragment is getting recreated on pressing backbutton

∥☆過路亽.° 提交于 2019-12-12 08:15:22
问题 I'm using loader in my ListView fragment, and it's getting recreated on pressing "back" button. Can you tell me how to handle this senario? Here is my ListView fragment code. Here I have a boolean variable that I'm setting as true on clicking on list item. but once the back button is pressed onCreateView will get called so the backbutton will be false. public class GTFragment extends SherlockFragment implements LoaderCallbacks<Cursor>{ ListView mTListview = null; GoogleTasksAdapter

Is it possible to load ListPreference items from an adapter?

做~自己de王妃 提交于 2019-12-12 07:55:59
问题 I'm setting out to create a settings activity for my app. I've defined a PreferenceActivity with a nice layout including a ListPreference object for the user to select a bluetooth device. I'm having trouble dynamically populating the list . I would like to populate ListPreference with values from an array adapter (which I'll create and populate with relevant bluetooth device names). If this were a spinner View, I could just call setAdapter() . However with the ListPreference object I can't

Design pattern for default implementation with empty methods

二次信任 提交于 2019-12-12 07:30:21
问题 Is there a specific design pattern that describes the scenario where a non-abstract default implementation is provided that implements all or some of the methods on the interface with empty, NO-OP implementations. This being done with the intent of alleviating subclasses with the burden of implementing methods that they themselves may not need/use: public interface MyInterface { public void doThis(); public void doThat(); public void done(); } public class MyClass implements MyInterface {

Cannot use notifyDataSetChanged to update adapter

不羁岁月 提交于 2019-12-12 06:39:46
问题 I cannot update my ListView after deleting an item. Listview item gets deleted from database but I cannot update my adapter and it keeps showing deleted item in listView. if I put adapter.notiftDataSetChanged(); it turns into red colored code strangely! And shows that cannot resolve the method notifyDataSetChanged(). Here is my code. ArrayList<HashMap<String, String>> items = new ArrayList<>(); List<TRListFormat> list = trDb.getAllReminders(); for (TRListFormat val : list) { HashMap<String,

Getting data from SimpleAdapter

拜拜、爱过 提交于 2019-12-12 05:58:31
问题 I'm trying to get data from a SimpleAdapter, but I don't know the syntax for it. Example code: month_selector.xml <LinearLayout android:orientation="vertical"> <TextView android:id="@+id/text" android:text="Month of birth" /> <Spinner android:id="@+id/spin_birthmonth" android:entries="@array/birthmonth" /> </LinearLayout> Activity page public class SomeActivity extends Activity { SimpleAdapter adapter; ListView lv; protected List<HashMap<String, String>> fillMaps; protected String[] from;

Set onClickListener into custom adapter

这一生的挚爱 提交于 2019-12-12 05:37:19
问题 Hello at all the community, i've this adapter with 2 button and 2 textview . @Override public View getView(int position, View view, ViewGroup parent) { if(view == null) { holder = new Holder(); inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); view = inflater.inflate(R.layout.my_adapter, null); holder.result = (TextView)view.findViewById(R.id.description); holder.value = (TextView)view.findViewById(R.id.value); holder.add = (Button)view.findViewById(R.id

Change the alpha of recyclerview item with beacon detection

 ̄綄美尐妖づ 提交于 2019-12-12 05:36:54
问题 In a Fragment I have a list of items construct with RecyclerView (adapter and viewholder). Each item of the list is linked with a estimote beacon. So i want to highlight the item view (setAlpha or add a imageView) when the beacon is detected. The beacon detection is in the fragment file : beaconManager.setRangingListener(new BeaconManager.RangingListener() { @Override public void onBeaconsDiscovered(Region region, List<Beacon> list) { if (!list.isEmpty()) { Beacon nearestBeacon = list.get(0);

Android: How to pass Data from an Adapter to the Main Activity from a OnClickListener

╄→гoц情女王★ 提交于 2019-12-12 05:17:45
问题 I am really stuck here, I am new to Programming. I achieved a lot in my Music App, but now I made a button in my listViewAdapter with a OnClickListener and I want to add a Song to the favList ArrayList in my MainActivity. With this code I have the Song I want, but how do I get it into the List? Here is my code for this: class SongAdapter extends ArrayAdapter<Song> { SongAdapter(Context context, ArrayList<Song> songs) { super(context, 0, songs); } @NonNull @Override public View getView(final

android: custom listview with checkbox, how to fill it

点点圈 提交于 2019-12-12 05:17:42
问题 i have a listview filled by a cursor database, and with a custom xml for the row. all works well, but i need to check or uncheck a checkbox in my row, dependig of the value in the db. i don't know how. this is my class: // inserisco gli elementi db.open(); Cursor prendi_preventivi=db.prendi_preventivi(); while(prendi_preventivi.moveToNext()){ String nome_preventivo=prendi_preventivi.getString(prendi_preventivi.getColumnIndex("nome")); String data_preventivo=prendi_preventivi.getString(prendi