Skip to content

Instantly share code, notes, and snippets.

@vivdub
Created Dec 14, 2010
Embed
What would you like to do?
final Handler handler=new Handler()
{
public void handleMessage(Bundle b){
Log.d("****","*********");
Log.d("calling","handler");
Log.d("****","*********");
parsedValue1=b.getStringArrayList("parsedValue");
for(int i=0;i<parsedValue1.size();i++)
{
DomParserTableDataSet dataSet=(DomParserTableDataSet)parsedValue1.get(i);
if(i==0)
{
Log.d("&&&&&&index name is", dataSet.getIndexName());
Log.d("&&&&&&index name is", dataSet.getLastValue());
Log.d("&&&&&&index name is",dataSet.getChangePercentage() );
txtindex0.setText(dataSet.getIndexName());
txtlast0.setText(dataSet.getLastValue());
txtchange0.setText(dataSet.getChangePercentage());
}
if(i==1)
{
Log.d("&&&&&&index name is", dataSet.getIndexName());
Log.d("&&&&&&index name is", dataSet.getLastValue());
Log.d("&&&&&&index name is",dataSet.getChangePercentage() );
txtindex1.setText(dataSet.getIndexName());
txtlast1.setText(dataSet.getLastValue());
txtchange1.setText(dataSet.getChangePercentage());
}
if(i==2)
{
Log.d("&&&&&&index name is", dataSet.getIndexName());
Log.d("&&&&&&index name is", dataSet.getLastValue());
Log.d("&&&&&&index name is",dataSet.getChangePercentage() );
txtindex2.setText(dataSet.getIndexName());
txtlast2.setText(dataSet.getLastValue());
txtchange2.setText(dataSet.getChangePercentage());
}
if(i==3)
{
Log.d("&&&&&&index name is", dataSet.getIndexName());
Log.d("&&&&&&index name is", dataSet.getLastValue());
Log.d("&&&&&&index name is",dataSet.getChangePercentage() );
txtindex3.setText(dataSet.getIndexName());
txtlast3.setText(dataSet.getLastValue());
txtchange3.setText(dataSet.getChangePercentage());
}
}
}
};
/*System.out.println("username"+strUsername);
System.out.println("password"+strPassWord);
System.out.println("grupid"+questGroupId);
System.out.println("userid"+userid);
System.out.println("sysuserid"+systemuserid);
System.out.println("checking"+checking);*/
Thread background=new Thread(new Runnable()
{
public void run()
{
try
{
WebService tableservice=new WebService();
tableservicevalue=tableservice.callTableServer(SOAP_ACTION,"",strUsername,strPassWord,questGroupId,URL);
tableservicevalue=decodeXMLData(tableservicevalue);
DomTableParser parser=new DomTableParser();
parser.setTableservicevalue(tableservicevalue);
parsedValue=parser.parseXmlFile(tableservicevalue);
Log.d("$$$$$$$parsed value$$$$$", parsedValue.toString());
WebService service=new WebService();
webservicevalue=service.callHomeServer(SOAP_ACTION,"",strUsername,strPassWord,questGroupId,URL);
webservicevalue=decodeXMLData(webservicevalue);
ArticleParser articleParser=new ArticleParser();
articleParsedValue=articleParser.parseXmlArticle(webservicevalue);
//b.putStringArrayList("articleParsedValue", articleParsedValue);
Log.d("(((((((parsed value is",parsedValue.toString());
Message msg=new Message();
Bundle b=new Bundle();
Log.i("message", " above b.putString");
b.putStringArrayList("parsedValue", parsedValue);
Log.i("message", " below b.putString");
msg.setData(b);
handler.sendMessage(msg);
}
catch(Exception e)
{
e.printStackTrace();
}
}
});
background.start();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment