android - How to pass a Bundle to a Fragment -


First of all I want to say that I hope everyone on the east coast is fine after Sandy. I was lucky in it, though I live in New York City, I never lost power, my thoughts go to those who were not fortunate. Now that I am working after three days, I need some help with pieces. I am trying to cross a bundle and it is not working. I know that I have a simple piece setup right, because if I do not try to cross the bundle, then it works fine. So here is my activity where I pass the bundle:
  ITEMClick (adapterview ; Gt; parent, view view, integer position, long ID) on public zero = New intent (getApplicationContext (), Com.MyProject.project.MyList.class); Bundle data bond = new bundle (); String selected V = value [position]; DataBundle.putString ("Level", selectedValue); Choice.putExtras (dataBundle); StartActivity (option); }   

Now the bundle is without my activity. It works fine:

  Operated on Public Zero (bundled saved instenstate) {super.onActivityCreated (SavedInstanceState ); String [] value = new string [] {"enterprise", "star trek", "next generation", "deep space 9", "wizard"}; ArrayAdapter & LT; String & gt; Adapter = new array adapter & lt; String & gt; (GetActivity (), android.R.layout.simple_list_item_1, value); SetListAdapter (adapter); }   

However, when I try to get information from the bundle, it does not work. Here is my code:

  Transmitted on Public Zero (bundled saved instanestate) {super.onActivityCreated (SavedInstanceState); Bundle information = findgridges (); String Level = info.getString ("level"); String [] value = new string [] {level, level}; ArrayAdapter & LT; String & gt; Adapter = new array adapter & lt; String & gt; (GetActivity (), android.R.layout.simple_list_item_1, value); SetListAdapter (adapter); }   

When I run it and click on my choice in my activity, the app is just hanging. LogCat does not seem to give me more information about it. Is there a problem here?

Thank you!

You need to set logic on fragmentation.

The activity's onCreate :

  in Fragmet myFragment = new MyFragment (); MyFragment.setArguments (getIntent (.) GetExtras ());    

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -