Click here to Skip to main content
15,665,663 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
Anybody know... just check all data string in hush map is correct or not. If correct can go next page ,else "NOT FOUND"

class LoadContentFromServer extends AsyncTask<Object, Integer, Object>{
		protected Object doInBackground(Object... params) {
			// TODO Auto-generated method stub
			String url = "";
			String ckCode = "";
			JSONObject data;
			JSONArray dataset;
			myArrList = new ArrayList<HashMap<String, Object>>();
			try {
				data = new JSONObject(getJSONUrl(url));
				dataset = data.getJSONArray("stock");
				myArrList = new ArrayList<HashMap<String,Object>>();
				List = new ArrayList<String>();
				HashMap<String, Object> map;
				for (int i = 0 ; i < dataset.length(); i ++){
						JSONObject c1 = dataset.getJSONObject(i);
						map = new HashMap<String, Object>();
						map.put("code", c1.getString("code").toString());
			} catch (Exception e) {
				// TODO: handle exception
			return null;

OnClick Nextpage..
public void next(View view){
        Intent nextScreen = new Intent(getApplicationContext(), FragmentGO.class);
        if(  ){
	    Toast.makeText(getApplicationContext(),"NOT FOUND",Toast.LENGTH_LONG).show();

thanks from suggestion :D
Updated 13-Aug-14 21:07pm
TorstenH. 14-Aug-14 2:09am    
never seen before - I assume it's written by you.

What is the question?

If it's not working: Your catch is empty - BIG MISTAKE! at least some e.printStackTrace(); should be in there.
Sergey Alexandrovich Kryukov 14-Aug-14 2:43am    
Big mistake indeed!
Eerven 14-Aug-14 3:05am    
thx TorstenH
Sergey Alexandrovich Kryukov 14-Aug-14 2:44am    
And what is the criteria for "correctness"?
Eerven 14-Aug-14 3:25am    
well, there's input from user text1. I going to check all data in hash map that's match text1. my qestion a bit confuse..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900