listview - Android fragment list view array from server side retrieve -
i got code work properly, need change array data retrieve server on finzacomtech[dot]com/testdata[dot]php below code:
package com.package.activity; import android.os.bundle; import android.support.v4.app.fragment; import android.view.layoutinflater; import android.view.view; import android.view.viewgroup; import android.widget.listview; import com.package.r; import java.util.arrays; public class mainactivityfragment extends fragment { private androidflavoradapter flavoradapter; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); } androidflavor[] androidflavors = { new androidflavor("cupcake", "1.5", r.drawable.cupcake), new androidflavor("donut", "1.6", r.drawable.donut), new androidflavor("eclair", "2.0-2.1", r.drawable.eclair), new androidflavor("froyo", "2.2-2.2.3", r.drawable.froyo), new androidflavor("gingerbread", "2.3-2.3.7", r.drawable.gingerbread), new androidflavor("honeycomb", "3.0-3.2.6", r.drawable.honeycomb), new androidflavor("ice cream sandwich", "4.0-4.0.4", r.drawable.icecream), new androidflavor("jelly bean", "4.1-4.3.1", r.drawable.jellybean), new androidflavor("kitkat", "4.4-4.4.4", r.drawable.kitkat), new androidflavor("lollipop", "5.0-5.1.1", r.drawable.lollipop) }; public mainactivityfragment() { } @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { view rootview = inflater.inflate(r.layout.fragment_main, container, false); flavoradapter = new androidflavoradapter(getactivity(), arrays.aslist(androidflavors)); // reference listview, , attach adapter it. listview listview = (listview) rootview.findviewbyid(r.id.listview_flavor); listview.setadapter(flavoradapter); return rootview; } }
i need change how retrieve data on finzacomtech[dot]com/testdata[dot]php format code below
androidflavor[] androidflavors = { new androidflavor("cupcake", "1.5", r.drawable.cupcake), new androidflavor("donut", "1.6", r.drawable.donut), new androidflavor("eclair", "2.0-2.1", r.drawable.eclair), new androidflavor("froyo", "2.2-2.2.3", r.drawable.froyo), new androidflavor("gingerbread", "2.3-2.3.7", r.drawable.gingerbread), new androidflavor("honeycomb", "3.0-3.2.6", r.drawable.honeycomb), new androidflavor("ice cream sandwich", "4.0-4.0.4", r.drawable.icecream), new androidflavor("jelly bean", "4.1-4.3.1", r.drawable.jellybean), new androidflavor("kitkat", "4.4-4.4.4", r.drawable.kitkat), new androidflavor("lollipop", "5.0-5.1.1", r.drawable.lollipop) };
Comments
Post a Comment