android - ListFragment onListItemClick not firing on first click on returning from back click -


Click the listfragment and list item. The implementation of ADT templates for tabs with pagers is directly out. The catalog pops up with the default adapter and default simple_list_item_1 - so no button, checkbox, etc. to capture the click event.

On returning from a description view, due to highlighting the item by clicking Next on the list view, but OnListenItemClick does not fire Click on the second fire and goes for detail this time in detail On seeing, it works on the first click. Next time it takes two more alternatives in that pattern.

R.id.pager is the main activity viewpage from the original layout. In addition, I'm popping backstacks into an online revision (). I do not understand why why take 2 clicks every time

Here the code is thanks! ContactListFragment Expands ListFragment {@Override Public View onCreateView (LayoutInflater Inflator, ViewGroup Container, Bundle savedInstanceState) {View contactsView = inflater.inflate (R.layout.fragment_contact_list, container, false); String json.data = contact .readContactsFromAssets (getActivity ()); ArrayList & LT; Contacts & gt; ContactList = Contact MacConnectList (JSNIDTA); ArrayAdapter & LT; Contacts & gt; Adapter = new array adapter & lt; Contacts & gt; (GetActivity (), android.R.layout.simple_list_item_1, contact list); setListAdapter (adapter); See return contact; } @ Override Public Wide OnListItemClick (ListView L, We V, Int Position, Long ID) {myContact = (Contact) l.getItemAtPosition (Status); ContactDetailFragment detailFragment = New ContactDetailFragment (); Bundle contactbundle = new bundle (); ContactBundle.putString ("CELL_NUMBER", myContact.getCellNumber ()); detailFragment.setArguments (contactBundle); Fragment Transaction Slice Transaction = getActivity () GetFragmentManager (). BeginTransaction (); fragmentTransaction.addToBackStack ("Contact"); Section Transaction. Raleigh (RID. Pager, Description Fragment, "Contact"); fragmentTransaction.commit (); } @Override Public Zero onViewStateRestored (bundled savedInstanceState) {super.onViewStateRestored (savedInstanceState); Fragment Manager FM = Mill Activity () GetFragmentManager (); Fm.popBackStack ("Contact", Fragment Manager. POP_BACK_STACK_INCLUSIVE); }}

The framing_contact_list layout looks like this:

  & lt; LinearLayout xmlns: Android = "http://schemas.android.com/apk/resAndroid: Android: Android: Android: layout_width =" match_perrent "Android: layout_heck =" match_perrent "android: paddingbottom =" @ daemon / activity_world_margin "android : Padding Lift = "@ Daemon / Activity_Hyjontal_margin" Android: PaddingRight = "@Demon / Activity_Horizontal_margin" Android: PaddingPop = "@Dimen / activity_vertical_margin" Android: id = "@ + id / contact_view"> gt; & lt; ListView Andrew D: ID = "@Android: ID / list" Android: layout_width = "match_parent" Android: layout_height = "wrap_content">    < After the "text" itemprop = "text"> 

onListItemClick was firing after all. The problem is that the list view remains visible. I call it onListItemClick () Can get lost with the following:

  l.setVisibility (android.view.View.GONE);   

However, Not sure how to look it up again onViewStateRestored () For now, I'll set a solid background for the piece. Ideally, however, I want to toggle the visibility on the ListView so that I can get the scene background.

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -