Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6728975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:14:01+00:00 2026-05-26T10:14:01+00:00

Firstly please check url* http://mobileecommerce.site247365.com/admin/catdata.xml in * google chrome . I am facing two

  • 0

Firstly please check url*http://mobileecommerce.site247365.com/admin/catdata.xml in* google chrome. I am facing two problems 1. For second cat_desc from xml having cat_name E n I Sept not showing on webview .I think it is because in its cat_desc contains % sign on first line in table style tag <“table style=”border-collapse:collapse;width :100%;”>How to ignore % sign?

2.Second problem is that, from last thrid tag with cat_name Handouts creating problem while parsing it cat_desc.It will not parse completely, its last three lines are not parsed .I will check it in log also,but last three lines are not paresd.Why is it so ?For other cat_desc are parsed very well and well working on webview.

public class FirstActivity extends ListActivity implements OnItemClickListener {
/** called when the activity is first created. */

String[] cat_name=null;
String[] cat_desc=null;
ListView optionslist=null;
NewsListAdapter adapter=null;
ArrayList<NewsItem> getArray=null;
ArrayAdapter<String> arrayadapter=null;
HashMap<String, String> hashamp=null;



public static final String url="http://mobileecommerce.site247365.com/admin/catdata.xml";
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);


    innitializeUIComponents();
    new RefreshArrayFromInternet().execute(url);


}

public void onItemClick(AdapterView<?> arg0, View arg1, int position, long arg3) {

    Log.v("in position", ""+position);

    String str=new String(getArray.get(position).getCatdesc());
    Log.v("on item click desc", str);
    Intent intent=new Intent(FirstActivity.this, WebviewActivity.class);
    intent.putExtra("str",str);
    startActivity(intent);
}
private void innitializeUIComponents()
{
    optionslist=getListView();
    optionslist.setOnItemClickListener(this);
}

private class RefreshArrayFromInternet extends AsyncTask<String,Void,ArrayList<NewsItem>>
{

    @Override
    protected ArrayList<com.example.vidushi.NewsItem> doInBackground(
            String... params) {


        Log.v("Thread started","parsing thread has started!!!");
        final ArrayList<NewsItem> newsList=new ArrayList<NewsItem>();
        try
        {
            URL urlexec=new URL(params[0]);
            URLConnection connection=urlexec.openConnection();
            InputStream input=connection.getInputStream();
            SAXParserFactory factory=SAXParserFactory.newInstance();
            SAXParser parser=factory.newSAXParser();

            parser.parse(input,new DefaultHandler(){

                boolean itemTagStarted=false;
                String currentTag="";           
                StringBuffer buffer;
                NewsItem item=null;
                @Override
                public void startDocument() throws SAXException {
                    Log.v("parsing started!!!","parsing started!!!");

                }
                @Override
                public void startElement(String uri, String localName,String qName, Attributes attributes)
                throws SAXException {
                    currentTag=localName;
                    Log.v("in start elelmet", "in start elelmet");
                    if(qName.equals("Table"))
                    {
                        buffer=new StringBuffer();
                        itemTagStarted=true;

                        item=new NewsItem();
                    }

                }
                @Override
                public void characters(char[] ch, int start, int length)
                        throws SAXException {

                    if(itemTagStarted)
                    {
                        if(currentTag.equals("Cat_Name"))
                        {
                            item.setCatname(String.valueOf(ch,start,length));

                        }
                        if(currentTag.equals("Cat_id"))
                        {

                            item.setCatid(String.valueOf(ch,start,length));
                        }

                        if(currentTag.equals("Cat_Desc"))
                        {
                            buffer.append(String.valueOf(ch,start,length));

                        }
                    }
                }

                @Override
                public void endElement(String uri, String localName,
                        String qName) throws SAXException {
                    currentTag="";

                    if(qName.equals("Table"))
                    {
                        itemTagStarted=false;
                        newsList.add(item);

                    }
                    if(qName.equals("Cat_Desc"))
                    {
                        item.setCatdesc(buffer.toString());
                        Log.v("Description data",buffer.toString());

                    }
                }
                @Override
                public void endDocument() throws SAXException {
                    Log.v("parsing completed","parsing completed : array size : "+newsList.size());
                }

            });
        }
            catch(Exception ex)
            {
                ex.printStackTrace();
            }

        return newsList;
    }

    @Override
    protected void onPostExecute(ArrayList<NewsItem> result) {
        super.onPostExecute(result);
        getArray=result;
        if(result.size()==0)
        {
            Toast.makeText(FirstActivity.this,"There is some problem with the internet connection or the specified url!!!",Toast.LENGTH_LONG).show();
        }
        String[] array=new String[result.size()];
        cat_desc=new String[result.size()];
        Log.v("resukt size",""+result.size());
        for(int i=0;i<result.size();i++)
        {
            array[i]=result.get(i).getCatname();

        }

        arrayadapter=new ArrayAdapter<String>(FirstActivity.this,android.R.layout.simple_list_item_1,array);
        optionslist.setAdapter(arrayadapter);

    }

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T10:14:02+00:00Added an answer on May 26, 2026 at 10:14 am

    I have gone this URl:-

    http://mobileecommerce.site247365.com/admin/catdata.xml"
    

    and find out that you have to make very small changes that use px instead of %.. as webview nor support %age symbol..
    Hope it helps.. 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Firstly, please go to this url: celebritywallpaperbase picture #1 is Drew Barrymore smile picture
Firstly, let me say that I know that http://sphinxsearch.com/docs/current.html#conf-sql-attr-string says strings can only be
Firstly, I'm totally javascript inept so please explain throughly. OK, I have two issues
Firstly, please take a look at a snippet in mule-config.xml : <model name=userModel> <service
Please understand firstly that I fully understand that Java will return a String when
Firstly this has turned out to be quite a long post so please bear
Firstly, please don't move to serverfault. It is indeed a programming question :-) We
Firstly, please don't dismiss this question - I'm aware it's an ugly situation but
Could you please explain me the logic of UNIX signal system: firstly it sends
Firstly, Happy New Year everyone. I'm new to Rails, so please tolerate any incorrect

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.