Question: What should i add to pass a bundle with name, height and mass to a fragment? What should the fragment class look like to receive
What should i add to pass a bundle with "name", "height" and "mass" to a fragment? What should the fragment class look like to receive that data?
Here is my MainActivity.java
public class MainActivity extends AppCompatActivity { private ListView listView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); listView = (ListView) findViewById(R.id.listView); JsonWork jsonWork = new JsonWork(); jsonWork.execute(); } private class JsonWork extends AsyncTask
and my JsonModel.java
public class JsonModel { private String name; private String height; private String mass; public String getName() { return name; } public void setName(String name) { this.name = name; } public String getHeight() { return height; } public void setHeight(String height) { this.height = height; } public String getMass() { return mass; } public void setMass(String mass) { this.mass = mass; } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
