i m working on xml parsing using xmlpullparser. m getting a java runtime
error :

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (classFileParser.cpp:3494), pid=5116, tid=4420
#  Error: ShouldNotReachHere()
#
# JRE version: 6.0_26-b03
# Java VM: Java HotSpot(TM) Client VM (20.1-b02 mixed mode windows-x86 )
# An error report file with more information is saved as:
# E:\workspace\update\hs_err_pid5116.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#

my code is :
package com.example.update;

import android.app.Activity;
import android.os.Bundle;
import android.widget.Toast;

import java.io.IOException;
import java.io.StringReader;


import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
import org.xmlpull.v1.XmlPullParserFactory;



public class update extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        try {
            try {
                filename();
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }catch (XmlPullParserException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
            }
    }
    public void filename ()
    throws XmlPullParserException, IOException
    {
        XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
        factory.setNamespaceAware(true);
        XmlPullParser xpp = factory.newPullParser();

        xpp.setInput( new StringReader ( "<foo>Hello World!</foo>" ) );
        int eventType = xpp.getEventType();
        while (eventType != XmlPullParser.END_DOCUMENT) {
             if(eventType == XmlPullParser.START_DOCUMENT) {
                 Toast.makeText(this, "Start document", 5000).show();
             } else if(eventType == XmlPullParser.START_TAG) {
                 Toast.makeText(this, "Start tag "+xpp.getName(),
5000).show();
             } else if(eventType == XmlPullParser.END_TAG) {
                 Toast.makeText(this,"End tag "+xpp.getName(),5000).show();
             } else if(eventType == XmlPullParser.TEXT) {
                 Toast.makeText(this, "Text "+xpp.getText(), 5000).show();
             }
             eventType = xpp.next();
        }
        Toast.makeText(this, "End document", 5000).show();
    }

}

what should i do ??


On Sun, Sep 11, 2011 at 1:09 PM, Kostya Vasilyev <kmans...@gmail.com> wrote:

> Use CharsetEncoder:
>
> http://developer.android.com/**reference/java/nio/charset/**
> CharsetEncoder.html<http://developer.android.com/reference/java/nio/charset/CharsetEncoder.html>
>
> Specify onUnmappableCharacter(REPLACE) and set your own replacement with
> replaceWith()
>
> http://developer.android.com/**reference/java/nio/charset/**
> CharsetEncoder.html#**onUnmappableCharacter(java.**
> nio.charset.CodingErrorAction)<http://developer.android.com/reference/java/nio/charset/CharsetEncoder.html#onUnmappableCharacter%28java.nio.charset.CodingErrorAction%29><
> http://developer.android.com/**reference/java/nio/charset/**
> CharsetEncoder.html#**onUnmappableCharacter%28java.**
> nio.charset.CodingErrorAction%**29<http://developer.android.com/reference/java/nio/charset/CharsetEncoder.html#onUnmappableCharacter%28java.nio.charset.CodingErrorAction%29>
> >
>
> http://developer.android.com/**reference/java/nio/charset/**
> CharsetEncoder.html#**replaceWith(byte[])<http://developer.android.com/reference/java/nio/charset/CharsetEncoder.html#replaceWith%28byte[]%29><
> http://developer.android.com/**reference/java/nio/charset/**
> CharsetEncoder.html#**replaceWith%28byte[]%29<http://developer.android.com/reference/java/nio/charset/CharsetEncoder.html#replaceWith%28byte[]%29>
> >
>
> -- Kostya
>
> 11.09.2011 7:37, bob пишет:
>
>> How do I tell Java what to replace a special UTF-8 character with when
>> converting to US-ASCII?
>>
>>
> --
> Kostya Vasilyev
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to 
> android-developers@**googlegroups.com<android-developers@googlegroups.com>
> To unsubscribe from this group, send email to
> android-developers+**unsubscr...@googlegroups.com<android-developers%2bunsubscr...@googlegroups.com>
> For more options, visit this group at
> http://groups.google.com/**group/android-developers?hl=en<http://groups.google.com/group/android-developers?hl=en>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to