Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid : After getting response from database its go back to previous screen
    primarykey
    data
    text
    <p>Can any one help me..?? My problem is that, after getting response from json [its coming from webservice, in that there is Select query to fetch records], instead of display in listview its go back to previous screen Here is my sample code for that..</p> <pre><code>public class MainActivity5 extends ListActivity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.custom_list_view); Intent i = getIntent(); phNumber = i.getStringExtra("phn_no"); new SearchCustomer().execute(); ListAdapter adapter = new SimpleAdapter(this, customerList, R.layout.activity_main5, new String[] { TAG_F_NAME, TAG_C_PHONE }, new int[] { R.id.TextViewName, R.id.TextViewPhone }); setListAdapter(adapter); } class SearchCustomer extends AsyncTask&lt;String, String, String&gt; { private boolean successFlag; @Override protected void onPreExecute() { super.onPreExecute(); pDialog = new ProgressDialog(MainActivity5.this); pDialog.setMessage("Searching Customer.."); pDialog.setIndeterminate(false); pDialog.setCancelable(true); pDialog.show(); } protected String doInBackground(String... args) { String inputPhnNoText = phNumber; List&lt;NameValuePair&gt; params = new ArrayList&lt;NameValuePair&gt;(); params.add(new BasicNameValuePair("phno", inputPhnNoText)); JSONObject json = jsonParser.makeHttpRequest(url_search_customer, "POST", params); Log.d("Search Response", json.toString()); try { int success = json.getInt(TAG_SUCCESS); if (success == 1) { successFlag = true; result = json.getJSONArray(TAG_RESULT); for (int i = 0; i &lt; result.length(); i++) { JSONObject c = result.getJSONObject(i); String id = c.getString(TAG_ID); String fname = c.getString(TAG_F_NAME); String phoneNumber = c.getString(TAG_C_PHONE); // creating new HashMap HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;(); // adding each child node to HashMap key =&gt; value map.put(TAG_ID, id); map.put(TAG_F_NAME, fname); map.put(TAG_C_PHONE, phoneNumber); // adding HashList to ArrayList customerList.add(map); } } else { successFlag = false; } } catch (JSONException e) { Log.e("log_tag", "Error parsing data " + e.toString()); } return null; } protected void onPostExecute(String file_url) { pDialog.dismiss(); finish(); } } } </code></pre> <p>This is my activity file code.. in doinbackground customerList I got the exact data what I want, but problem is that its not stay in the custom_list_view screen its go back to previous screen where a textbox and search button are there.. so not able to show record...</p> <p>Everybody please, can any one give solution to this silly thing?</p>
    singulars
    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.
    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