What's the problem?

3 replies [Last post]
songotho
User offline. Last seen 2 years 47 weeks ago. Offline
Joined: 03/11/2009

I dont know the problem in code.

protected Dialog onCreateDialog(int id, Context ctx) {

FileInputStream istream = null;
try {
istream = (FileInputStream) ctx.getResources().openRawResource(R.xml.sample);

/* Get a SAXParser from the SAXPArserFactory. */
SAXParserFactory spf = SAXParserFactory.newInstance();
SAXParser sp = spf.newSAXParser();
/* Get the XMLReader of the SAXParser we created. */
XMLReader xr = sp.getXMLReader();
/* Create a new ContentHandler and apply it to the XML-Reader*/
ExampleHandler myExampleHandler = new ExampleHandler();
xr.setContentHandler(myExampleHandler);
/* Parse the xml-data from our URL. */
xr.parse(new InputSource(istream));
/* Parsing has finished. */

/* Our ExampleHandler now provides the parsed data to us. */
ParsedExampleDataSet parsedExampleDataSet = myExampleHandler.getParsedData();

switch (id) {
case DIALOG_MESSAGE:
return new AlertDialog.Builder(MainMenu.this)
//.setIcon(R.drawable.dialog_icon)
.setTitle("Test set text from local file"
.setMessage(parsedExampleDataSet.toString1())
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {

/* User clicked OK so do some stuff */
}
})
.setNeutralButton("Something", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {

/* User clicked Something so do some stuff */
}
})
.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {

/* User clicked Cancel so do some stuff */
}
})
.create();
}
}
catch (Exception e){
e.getMessage();
}
return null;
}

1xuntong
User offline. Last seen 5 weeks 5 days ago. Offline
Joined: 12/25/2011
miu miu

prada bags discount gently move, who place constantly. Make the eyes of tentacles, birds, plants must be leaves, branches of the image is clear, these figures are remarkably true. Wear it on the head, no doubt, will increase a JiaoTai beautiful appearance.

pandorauk
User offline. Last seen 1 year 8 weeks ago. Offline
Joined: 12/07/2010
Way back in Pandora I was

Way back in Pandora I was approached by Sid’s mother to do a book about Sid Vicious, obviously. With Pandora Bracelets crystal ball in one hand

Allen
User offline. Last seen 1 year 18 weeks ago. Offline
Joined: 12/31/2009
And the beast reborn spread

And the beast reborn spread over the earth and its numbers grew legion CISSP. And they
proclaimed the times and sacrificed crops unto the fire, with the cunning of
foxes E20-001. And they built a new world in their own image as promised by the sacred
words, and spoke of the beast with their children E20-322. Mammon awoke, and lo! it was
naught but a follower.