slt
lorsque je clique sur une item le toast ne s'affiche pas :( :roll:
Version imprimable
Bonjour,
Je ne sais pas quoi te dire ton code a l'air correct .
Essaye de débugger ton application en mettant soit un log soit un breakpoint dans la procédure OnItemClick ( au tout début avant le HashMap ).
Met ça sur le composant ratingbar dans ton xml (pour les items de ta liste) :
Code:android:isIndicator="true"
slt ,
merci pour votre aide mais le probléme c que le programme s'arrete jusqu'a
et le reste du code ne lire pas j'ai sais pas pourquoi et sa le reste du codeCode:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68 public class Restaurant extends ListActivity { String urlresto= "http://www.monresto.net/partenaires/restaurant/"; int width = 100; int height = 200; //TextView tv; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);; setContentView(R.layout.listplaceholder); Button button = new Button(this); Bundle bundle = getIntent().getExtras(); if (bundle != null) { button.setText("Item name = " + bundle.getString("id") + " --- Go Back "); } else { button.setText("Go Back"); } ArrayList<HashMap<String, Object>> mylist = new ArrayList<HashMap<String, Object>>(); JSONObject json = JSONfunctions.getJSONfromURL("http://monresto.net/android/marsa.php?id_cp="+ bundle.getString("id")); try{ JSONArray monrestodb1 = json.getJSONArray("monrestodb1"); for(int i=0;i<monrestodb1.length();i++){ HashMap<String, Object> map = new HashMap<String, Object>(); JSONObject e = monrestodb1.getJSONObject(i); map.put("name", String.valueOf(i)); map.put("name", "" + e.getString("nom")); map.put("id", "" + e.getString("id")); //map.put("photo",bitmap); map.put("photo", "" + e.getString("photo")); URL aURL = new URL("http://monresto.net/partenaires/restaurant/"+ e.getString("photo")); Bitmap bitmap = BitmapFactory.decodeStream(aURL.openStream()); //bitmap.getScaledHeight(200); //bitmap.getScaledWidth(100); map.put("photo",bitmap); //map.put("magnitude", "Magnitude: " + e.getString("magnitude")); mylist.add(map); } }catch(JSONException e) { Log.e("log_tag", "Error parsing data "+e.toString()); } catch (MalformedURLException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } SimpleAdapter adapter = new SimpleAdapter(this, mylist , R.layout.listmontplaisir, new String[] { "name", "photo","id" }, new int[] { R.id.montplaisirtext , R.id.image }); adapter.setViewBinder(new MyViewBinder()); setListAdapter(adapter);
et dans la piéce jointe c qui affiche le logcatCode:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 final ListView lv = getListView(); lv.setTextFilterEnabled(true); lv.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View view, int position, long id) { @SuppressWarnings("unchecked") HashMap<String, String> o = (HashMap<String, String>) lv.getItemAtPosition(position); Toast.makeText(Restaurant.this, "NAME '" + o.get("id") + "' was clicked.", Toast.LENGTH_SHORT).show(); Intent intent = new Intent(Restaurant.this, Famille_plat.class); //intent.putExtra("url", "http://monresto.net/android/marsa.php"); String txt = o.get("id"); intent.putExtra("id", txt); startActivity(intent); } }); } }
aider moi svp c tres urgent de mon projet et ma soutenance le lundi :cry:
Et tu peux pas débuguer ton programme avec le débugueur car là sans boule magique ça va être très dur de t'aider :?
http://eclipse.developpez.com/faq/?p...ement#debugger
et
http://jmdoudoux.developpez.com/cour...ipse-debug.php
Slt, ca va? :)
Vous pouvez m'aider car j'ai présque 15 jours pour resoudre le dedoublement du plat dans panier a fin du l'application
et une image de dédoublement de plat au panier.
Plat.java
ProductAdapter.javaCode:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124 package com.pxr.tutorial.json; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import android.app.ListActivity; import android.content.Intent; import android.os.Bundle; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.AdapterView; import android.widget.Button; import android.widget.ListAdapter; import android.widget.ListView; import android.widget.SimpleAdapter; import android.widget.SlidingDrawer; import android.widget.Toast; import android.widget.AdapterView.OnItemClickListener; import com.pxr.tutorial.xmltest.R; public class Plat extends ListActivity { Button slideHandleButton; SlidingDrawer slidingDrawer; HashMap<String, String> product; // private List<Product> mProductList; private List<monrestodb1> mnrestodb1List; ArrayList<HashMap<String, String>> mylist = new ArrayList<HashMap<String, String>>();//TextView tv; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);; setContentView(R.layout.listplat); //slideHandleButton = (Button) findViewById(R.id.slideHandleButton); mnrestodb1List = ShoppingCartHelper.getCatalog(getResources()); Button button = new Button(this); Bundle bundle = getIntent().getExtras(); if (bundle != null) { button.setText("Item name = " + bundle.getString("id") + " --- Go Back "); } else { button.setText("Go Back"); } ArrayList<HashMap<String, String>> mylist = new ArrayList<HashMap<String, String>>(); JSONObject json = JSONfunctions.getJSONfromURL("http://monresto.net/android/plat.php?id_famille="+ bundle.getString("id")); try{ JSONArray monrestodb1 = json.getJSONArray("monrestodb1"); for(int i=0;i<monrestodb1.length();i++){ HashMap<String, String> map = new HashMap<String, String>(); JSONObject e = monrestodb1.getJSONObject(i); map.put("name", String.valueOf(i)); map.put("name", "" + e.getString("nom")); map.put("id_famille", "" + e.getString("id_famille")); map.put("id", "" + e.getString("id")); map.put("prix", "Prix: " + e.getString("prix")); //map.put("magnitude", "Magnitude: " + e.getString("magnitude")); mylist.add(map); } }catch(JSONException e) { Log.e("log_tag", "Error parsing data "+e.toString()); } ListAdapter adapter = new SimpleAdapter(this, mylist , R.layout.plat, new String[] { "name", "prix" }, new int[] { R.id.platitem_title , R.id.prixitem_subtitle }); setListAdapter(adapter); final ListView lv = getListView(); lv.setTextFilterEnabled(true); lv.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View view, int position, long id) { @SuppressWarnings("unchecked") HashMap<String, String> o = (HashMap<String, String>) lv.getItemAtPosition(position); monrestodb1.setName(""+o.get("name")); monrestodb1.setPrix(""+o.get("prix")); //monrestodb1.setproductImage(""+o.get("prix")); Toast.makeText(Plat.this, " '" + o.get("name") + o.get("prix")+ "' was clicked.", Toast.LENGTH_SHORT).show(); Intent intent = new Intent(getBaseContext(),ProductDetailsActivity.class); intent.putExtra(ShoppingCartHelper.PRODUCT_INDEX, position); String name = o.get("name"); String prix = o.get("prix"); //intent.putExtra("id", txt); intent.putExtra("name", name); intent.putExtra("prix", prix); //intent.putExtra("name", prix ); startActivity(intent); } }); Button viewShoppingCart = (Button) findViewById(R.id.ButtonViewCart); viewShoppingCart.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { Intent viewShoppingCartIntent = new Intent(getBaseContext(), ShoppingCartActivity.class); startActivity(viewShoppingCartIntent); } }); //Intent intent = new Intent(Plat.this, Panier.class); //intent.putExtra("url", "http://monresto.net/android/marsa.php"); }}
ProductDetailsActivity.javaCode:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88 package com.pxr.tutorial.json; import java.util.List; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.CheckBox; import android.widget.TextView; import com.pxr.tutorial.xmltest.R; public class ProductAdapter extends BaseAdapter { public static List<monrestodb1> mnrestodb1List; private LayoutInflater mInflater; private boolean mShowCheckbox; public ProductAdapter(List<monrestodb1> list, LayoutInflater inflater, boolean showCheckbox) { mnrestodb1List = list; mInflater = inflater; mShowCheckbox = showCheckbox; } @Override public int getCount() { return mnrestodb1List.size(); } @Override public Object getItem(int position) { return mnrestodb1List.get(position); } @Override public long getItemId(int position) { return position; } @Override public View getView(int position, View convertView, ViewGroup parent) { final ViewItem item; if (convertView == null) { convertView = mInflater.inflate(R.layout.item, null); item = new ViewItem(); //item.productImageView = (ImageView) convertView // .findViewById(R.id.ImageViewItem); item.productTitle = (TextView) convertView.findViewById(R.id.TextViewItemtitle); item.productPrix = (TextView) convertView.findViewById(R.id.TextViewItem); item.productCheckbox = (CheckBox) convertView.findViewById(R.id.CheckBoxSelected); convertView.setTag(item); } else { item = (ViewItem) convertView.getTag(); } monrestodb1 curProduct = mnrestodb1List.get(position); //item.productImageView.setImageDrawable(curProduct.productImage); item.productTitle.setText(curProduct.name); item.productPrix.setText(curProduct.prix); if(!mShowCheckbox) { item.productCheckbox.setVisibility(View.GONE); } else { if(curProduct.selected == true) item.productCheckbox.setChecked(true); else item.productCheckbox.setChecked(false); } return convertView; } private class ViewItem { // ImageView productImageView; TextView productPrix; TextView productTitle; CheckBox productCheckbox; } }
ShoppingCartActivity.javaCode:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64 package com.pxr.tutorial.json; import java.util.List; import android.app.Activity; import android.os.Bundle; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.TextView; import com.pxr.tutorial.xmltest.R; public class ProductDetailsActivity extends Activity { @SuppressWarnings("static-access") @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.productdetails); //Bundle extra = getIntent().getExtras(); //String Variable = extra.getString("name"); // String Variableprix = extra.getString("prix"); List<monrestodb1> catalog = ShoppingCartHelper.getCatalog(getResources()); final List<monrestodb1> cart = ShoppingCartHelper.getCart(); int productIndex = getIntent().getExtras().getInt(ShoppingCartHelper.PRODUCT_INDEX); final monrestodb1 selectedmonrestodb1 = catalog.get(productIndex); // Set the proper image and text //ImageView productImageView = (ImageView) findViewById(R.id.ImageViewProduct); //productImageView.setImageDrawable(selectedProduct.productImage); TextView productDetailsTextView = (TextView) findViewById(R.id.TextViewProductTitle); productDetailsTextView.setText(selectedmonrestodb1.name); TextView productTitleTextView = (TextView) findViewById(R.id.TextViewProductDetails); productTitleTextView.setText(selectedmonrestodb1.prix); //TextView productDetailsTextView = (TextView) findViewById(R.id.TextViewProductTitle); //productDetailsTextView.setText(selectedmonrestodb1.name); Button addToCartButton = (Button) findViewById(R.id.ButtonAddToCart); addToCartButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { cart.add(selectedmonrestodb1); finish(); } }); // Disable the add to cart button if the item is already in the cart //if(cart.contains(selectedmonrestodb1)) { //addToCartButton.setEnabled(false); // addToCartButton.setText("Item in Cart"); // } } }
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73 package com.pxr.tutorial.json; import java.util.List; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.AdapterView; import android.widget.Button; import android.widget.ListView; import android.widget.AdapterView.OnItemClickListener; import com.pxr.tutorial.xmltest.R; public class ShoppingCartActivity extends Activity { private List<monrestodb1> mCartList; private ProductAdapter mProductAdapter; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.shoppingcart); mCartList = ShoppingCartHelper.getCart(); // Make sure to clear the selections for(int i=0; i<mCartList.size(); i++) { mCartList.get(i).selected = false; } // Create the list final ListView listViewCatalog = (ListView) findViewById(R.id.ListViewCatalog); mProductAdapter = new ProductAdapter(mCartList, getLayoutInflater(), true); listViewCatalog.setAdapter(mProductAdapter); listViewCatalog.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { monrestodb1 selectedmonrestodb1 = mCartList.get(position); if(selectedmonrestodb1.selected == true) selectedmonrestodb1.selected = false; else selectedmonrestodb1.selected = true; mProductAdapter.notifyDataSetInvalidated(); } }); Button removeButton = (Button) findViewById(R.id.ButtonRemoveFromCart); removeButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // Loop through and remove all the products that are selected // Loop backwards so that the remove works correctly for(int i=mCartList.size()-1; i>=0; i--) { if(mCartList.get(i).selected) { mCartList.remove(i); } } mProductAdapter.notifyDataSetChanged(); } }); } }
monrestodb1.javaCode::aie:
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44 package com.pxr.tutorial.json; public class monrestodb1 { public static String name; public static String prix; public static String id; public boolean selected; public monrestodb1(String name, String prix, double d) { monrestodb1.setName(name); monrestodb1.setPrix(prix); } public static String setName(String name) { return monrestodb1.name = name; } public String getTitre() { return name; } public static void setPrix(String prix) { monrestodb1.prix = prix; } public String getPrix() { return prix; } public String getImage() { // TODO Auto-generated method stub return null; } }
D'habitude on se plaint parce que les gens ne mettent pas de codes... ^^
Par contre je n'ai pas trop saisi ton problème et surtout où tu bloques
Si tu utilises le debugueur tu pourras cerner précisément à quel moment tu mets deux fois ta donnée dans une de tes listes.
Sais-tu utiliser le debugueur ?
les logs (traces d'exécution) sont bien différentes des possibilités du debugueur. Le but n'est pas du tout le même.
C'est une très grave erreur de debuguer un projet avec des logs.
Bonjour
Essaye d'abord de déboguer ton application.Citation:
les logs (traces d'exécution) sont bien différentes des possibilités du debugueur. Le but n'est pas du tout le même.
C'est une très grave erreur de debuguer un projet avec des logs.
http://feanorin.developpez.com/tutor...plication/#LVI
Juste pour info ta monrestodb1.java :
- Mettre une majuscule pour le nom d'une classe sinon on comprend rien entre le nom de la classe et le nom des champs (voir classe Plat.java)
- Ensuite, ça ressemble à un bean mais avec des champs static (name, prix, id). Pourtant dans ton code tu gères ça avec un catalogue dans une liste de monrestodb1, j'ai l'impression que ta classe monrestodb1 est un produit, donc comme tu mets des champs static ça sera toujours le même produit...
slt cv?
j'ai déjà parser des information dans textview avec json mais lorsque je change mon code avec une listview sa marche pas au niveau simpleAdapter
et il ma données cette erreur :
The constructor SimpleAdapter(new View.OnClickListener(){}, ArrayList<HashMap<String,Object>>, int, String[], int[]) is undefined
et ca mon code
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181 package com.saturne.externalDB; import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; import java.util.HashMap; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import android.app.ListActivity; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.os.Bundle; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.AdapterView; import android.widget.Button; import android.widget.EditText; import android.widget.ListView; import android.widget.SimpleAdapter; import android.widget.TextView; import android.widget.AdapterView.OnItemClickListener; public class Main extends ListActivity { String URL = "http://www.forsa2buy.com/android/annoncestest.php?"; // private static final String CLASSTAG = SimpleGet.class.getSimpleName(); private EditText getLogin; // private EditText getPassword; private TextView getOutput; private Button getButton; @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.main); this.getLogin = (EditText) findViewById(R.id.get_login); // getLogin.setText(""); // this.getPassword = (EditText) findViewById(R.id.get_password); // getPassword.setText(""); this.getOutput = (TextView) findViewById(R.id.get_output); this.getButton = (Button) findViewById(R.id.get_button); this.getButton.setOnClickListener(new OnClickListener() { public void onClick(View v) { ArrayList<HashMap<String, Object>> mylist = new ArrayList<HashMap<String, Object>>(); //getOutput.setText(""); String logintophp = "&search="+getLogin.getText().toString(); final JSONObject json = JSONfunctions.getJSONfromURL(URL+logintophp); try{ JSONArray forsa2buy = json.getJSONArray("forsa2buy"); for(int i=0;i<forsa2buy.length();i++){ HashMap<String, Object> map = new HashMap<String, Object>(); JSONObject e = forsa2buy.getJSONObject(i); map.put("prix", String.valueOf(i)); map.put("prix", "" + e.getString("prix")); map.put("titre", "" + e.getString("titre")); map.put("nom", "" + e.getString("nom")); map.put("id", "" + e.getString("id")); //map.put("photo",bitmap); //map.put("photo", "" + e.getString("photo")); URL aURL = new URL(e.getString("photo")); Bitmap bitmap = BitmapFactory.decodeStream(aURL.openStream()); //bitmap.getScaledHeight(200); //bitmap.getScaledWidth(100); map.put("photo",bitmap); //map.put("magnitude", "Magnitude: " + e.getString("magnitude")); mylist.add(map); } }catch(JSONException e) { Log.e("log_tag", "Error parsing data "+e.toString()); } catch (MalformedURLException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } SimpleAdapter adapter = new SimpleAdapter(this, mylist , R.layout.annoncevehicules, new String[] { "prix","titre","nom","photo" }, new int[] { R.id.annoncesvehprix ,R.id.annoncesvehtitre,R.id.annoncesvehnom,R.id.bt }); adapter.setViewBinder(new MyViewBinder()); setListAdapter(adapter); final ListView lv = getListView(); lv.setTextFilterEnabled(true); lv.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View view, int position, long id) { @SuppressWarnings("unchecked") HashMap<String, String> o = (HashMap<String, String>) lv.getItemAtPosition(position); //Toast.makeText(Famille_plat.this, "NAME '" + o.get("id") + "' was clicked.", Toast.LENGTH_SHORT).show(); //pd = ProgressDialog.show(Famille_plat.this, "Obtenir les plats", // "S'il vous pla�t patienter pendant que nous recherchons...", true, false); // } }); // String logintophp = "&search="+getLogin.getText().toString(); // String passwordtophp = "&password="+getPassword.getText().toString(); // String output = getHttpResponse(URL+logintophp); // if (output != null) { // getOutput.setText(output); /*******************************************/ } // } }); }; /** * Perform an HTTP GET with HttpUrlConnection. * * @param location * @return */ // private String getHttpResponse(String location) { // StringBuffer result = new StringBuffer(); // URL url = null; // Log.d(Constants.LOGTAG, " " + SimpleGet.CLASSTAG + " location = " + location); // try { // url = new URL(location); // Log.d(Constants.LOGTAG, " " + SimpleGet.CLASSTAG + " url = " + url); // } catch (MalformedURLException e) { // Log.e(Constants.LOGTAG, " " + SimpleGet.CLASSTAG + " " + e.getMessage()); // } // if (url != null) { // try { // HttpURLConnection urlConn = (HttpURLConnection) url.openConnection(); // BufferedReader in = new BufferedReader(new InputStreamReader(urlConn.getInputStream())); // String inputLine; // int lineCount = 0; // limit the lines for the example // while ((lineCount < 10) && ((inputLine = in.readLine()) != null)) { // lineCount++; // Log.v(Constants.LOGTAG, " " + SimpleGet.CLASSTAG + " inputLine = " + inputLine); // result.append(inputLine); //result += "\n" + inputLine; // } // // in.close(); // urlConn.disconnect(); // } catch (IOException e) { // Log.e(Constants.LOGTAG, " " + SimpleGet.CLASSTAG + " " + e.getMessage()); // } // } else { // Log.e(Constants.LOGTAG, " " + SimpleGet.CLASSTAG + " url NULL"); // } // return result.toString(); // } public void onClick(View arg0) { // TODO Auto-generated method stub } }
Bonjour,
Je pense que tu as un problème sur ta déclaration du SimpleAdapter.
http://developer.android.com/referen...leAdapter.html
Donc dans ton code utilise GetBAseContext() ou GetApplicationContext() pour récupérer le bon Context :aie: :Code:public SimpleAdapter (Context context, List<? extends Map<String, ?>> data, int resource, String[] from, int[] to)
Code:
1
2
3 SimpleAdapter adapter = new SimpleAdapter(GetApplicationContext(), mylist , R.layout.annoncevehicules, new String[] { "prix","titre","nom","photo" }, new int[] { R.id.annoncesvehprix ,R.id.annoncesvehtitre,R.id.annoncesvehnom,R.id.bt });