package com.example.apidemo;

import com.example.apidemo.MainActivity.LongOperation;

import in.shoppingwish.scandid.net.JSONConstants;
import in.shoppingwish.scandid.net.LocalSearchResult;
import in.shoppingwish.scandid.net.Product;
import in.shoppingwish.scandid.net.ScandidRequestHandler;
import in.shoppingwish.scandid.net.SearchResult;
import android.app.ListActivity;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;

public class LocalResultListActivity extends ListActivity{
	 ScandidRequestHandler scandidRequestHandler;
	 String prodID;
	 LocalSearchResult searchResult;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		searchResult = (LocalSearchResult)getIntent().getSerializableExtra("SearchResult");
		if(!searchResult.get_localSearchResponseMessage().equals(JSONConstants.RESPONSE_ERROR))
		{
			String str[] = new String[searchResult.get_localSearchStores().length];
			for(int i=0;i<searchResult.get_localSearchStores().length;i++) {
				str[i] = searchResult.get_localSearchStores()[i].get_localStoreName()+"\nAddress"+
						 searchResult.get_localSearchStores()[i].get_localStoreAddressLine1()+" "+
						 searchResult.get_localSearchStores()[i].get_localStoreAddressLine2();
				
			}
			
			ArrayAdapter<String> arrayAdapter = new ArrayAdapter<String>(this,R.layout.list_s,str);
			setListAdapter(arrayAdapter);
			
		}
		
		
		
		
	}
	 
	
}
