Mysql
 sql >> Datenbank >  >> RDS >> Mysql

Android erhält Daten aus der MySql-Tabelle

runOnUiThread(new Runnable() {  
                    @Override
                    public void run() 
                    {
                        // TODO Auto-generated method stub
                        try {


                            txt3.setText(product.getString(TAG_DESCRIPTION));

                        } catch (JSONException e) {
                            // TODO Auto-generated catch block
                            e.printStackTrace();
                        }
                    }
                });

            }else{
                // product with pid not found
            }

fügen Sie diese Zeile nach

hinzu
/ get first product object from JSON Array
                            JSONObject product = productObj.getJSONObject(0);

                            // product with this pid found
                            // Edit Text
                            txtName = (TextView) findViewById(R.id.textView3);

das wird das Problem lösen