Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 157 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

I posted some answers for readers here: How-Tto write a custom filter for ListView with ArrayAdapter

On my last post, I was trying to add xml. In the end I added it as an image, as it kept being interpreted, although I tried to add it as a code block. Any advice on adding xml inline please?

Also, I added a large code block (in a code fragment) and it got broken up. Some is displayed as text, some in a scrolling window (as it should be).

Would someone be able to check my post and advise please?

share|improve this question
possible duplicate of How do I format my code blocks? – Jon Seigel Mar 23 '11 at 16:56
You format xml just like code blocks, which you are able to do. But you have more problems. You're treating StackOverflow like a forum--you have three answers in that question; you should only have one. Also, you've dumped tons of code and xml in your answers. You should only put relevant lines in. Editing down your answers is very important for readability. – Won't Mar 23 '11 at 17:00

When there are blank spaces in the beginning of some lines pasted from some IDE it might mess things up - four spaces means "parse this line as code block".

Usually selecting the whole block and clicking the code icon in the editor or pressing CTRL+K will fix this, I tried with your last block and the preview show it should work - give this a try and see for yourself.

Same goes for XML - are you sure you're using the correct icon? It's looks like this: {}

share|improve this answer

Here's a fragment of XML like yours that doesn't get munged:

<?xml version="1.0" encoding="utf-8">
<LinearLayout xmlns:android="xxx"
    <TextView blah="asdf" />    

I just pasted this in, selected the code, then hit the {} icon. Look at the source of this answer to see the text formatting/indentation.

share|improve this answer
Nice, I've made it look like XML as well by adding <!-- language: lang-xml --> - see the edit source. :) – Shadow Wizard Mar 25 '11 at 9:16
@Shadow - Thanks for the tip and the edit! – bstpierre Mar 25 '11 at 12:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .