Note that there are some explanatory texts on larger screens.

plurals
  1. POjava.lang.NullPointerException Erro ao usar Buffered
    primarykey
    data
    text
    <p>Ao tentar executar a classe ConectPhp</p> <p>Meu LogCat traz o seguinte erro:</p> <p>Erro ao converter resultado java.lang.NullPointerException</p> <pre><code>public class ConectPhp extends ListActivity { public static InputStream inpStrin = null; String result = ""; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ArrayList&lt;NameValuePair&gt; parametros = new ArrayList&lt;NameValuePair&gt;(); parametros.add(new BasicNameValuePair("DATA", "2011-11-05")); try{ HttpClient httpcliente = new DefaultHttpClient(); HttpPost httppost = new HttpPost("http://192.168.254.15/mobile/ConexaoWcrm.php/"); httppost.setEntity(new UrlEncodedFormEntity(parametros)); HttpResponse response = httpcliente.execute(httppost); HttpEntity entity = response.getEntity(); } catch (Exception e){ Log.e("log_tag", "Erro em conectar a "+e.toString()); } try{ BufferedReader reader = new BufferedReader(new InputStreamReader(inpStrin, "iso-8859-1"), 8); StringBuilder sb = new StringBuilder(); String line = null; while((line = reader.readLine()) != null){ sb.append(line+"\n"); } inpStrin.close(); result=sb.toString(); }catch (Exception e){ Log.e("log_tag","Erro ao converter resultado"+e.toString()); } try{ JSONArray jArray = new JSONArray(result); String[] clientes = new String[jArray.length()]; for(int i=0; i&lt;jArray.length();i++){ JSONObject json_data = jArray.getJSONObject(i); clientes[i]=json_data.getString("clientnome"); } this.setListAdapter(new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1, clientes)); }catch(Exception e){ Log.e("log_tag","Erro ao popular os dados "+e.toString()); } setContentView(R.layout.conectphp); }} </code></pre> <p>Estrou testando uma conexão com um banco de dados externo para listra seus dados na tela do Android.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload