What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 127 Stack Exchange communities.

I am having difficulties asking a question on Stack Overflow, I indent my code by four spaces, but I get this error:

Oops! Your question couldn't be submitted because: Your post appears to contain code that is not properly formatted as code. Please indent all code by 4 spaces using the code toolbar button or the CTRL+K keyboard shortcut. For more editing help, click the [?] toolbar icon.

I posted the following question:

i have database like this : table.pepak, table.category, table.subcategory
i just want to display category if i click one of the pepak.name
But now if i click one of pepak.name, my app was error and stopped.


Menu.java

    public class Menu extends ListActivity{
        protected SQLiteDatabase db;
        protected Cursor cursor;
        protected ListAdapter adapter;

        @Override
        protected void onCreate(Bundle savedInstanceState) {
            // TODO Auto-generated method stub
            super.onCreate(savedInstanceState);
            setContentView(R.layout.main);
            db = (new DatabaseHelper(this)).getWritableDatabase();
            cursor = db.rawQuery("SELECT _id, name FROM pepak", null);
            adapter = new SimpleCursorAdapter(
            this, 
            R.layout.pepaklist,
            cursor, 
            new String[] {"name"}, 
            new int[] {R.id.name});
            setListAdapter(adapter);
    }
         public void onListItemClick(ListView parent, View view, int position, long id) {
                Intent intent = new Intent(this, PepakCats.class);
                Cursor cursor = (Cursor) adapter.getItem(position);
                intent.putExtra("PEPAK_ID", cursor.getInt(cursor.getColumnIndex("_id")));
                startActivity(intent);
            }

         @Override
        public boolean onCreateOptionsMenu(android.view.Menu menu) {
            // TODO Auto-generated method stub
            super.onCreateOptionsMenu(menu);
            MenuInflater blowUp =  getMenuInflater();
            blowUp.inflate(R.menu.coll_menu, menu);
            return true;
        }

        @Override
        public boolean onOptionsItemSelected(MenuItem item) {
            // TODO Auto-generated method stub
         switch(item.getItemId()){
         case R.id.about:
             Intent i = new Intent("com.pepakbahasajawa.ABOUT");
             startActivity(i);
             break;
         case R.id.exit:
                finish();
                break;
         }
         return false;
        }

    }




PepakCats.java



    public class PepakCats extends ListActivity {
        protected Cursor cursor;
        protected ListAdapter adapter;
        protected int pepakId;

        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.category);

            pepakId = getIntent().getIntExtra("PEPAK_ID", 0);
            SQLiteDatabase db = (new DatabaseHelper(this)).getWritableDatabase();
            Cursor cursor = db.rawQuery("SELECT _id, pepakId, catname FROM category WHERE pepakId = ?", 
                    new String[]{""+pepakId});
            adapter = new SimpleCursorAdapter(
            this, 
            R.layout.category_list,
            cursor, 
            new String[] {"catname"}, 
            new int[] {R.id.catname});
            setListAdapter(adapter);
        }
    }




*thanks in advance*
share|improve this question

migrated from stackoverflow.com Oct 5 '11 at 22:15

This question came from our site for professional and enthusiast programmers.

    
Why was this closed as off topic instead of migrated to meta? –  corsiKa Oct 5 '11 at 22:11
    
hi, i realy thanks for vote down. –  gabisabobo Oct 5 '11 at 22:13
    
i wanna ask, i want to paste my post here but i cant. always error. –  gabisabobo Oct 5 '11 at 22:15
2  
What's up with all those variables i in your text? –  Arjan Oct 5 '11 at 22:20
    
can you paste the text of your question here and use the toolbar to indent it by 4 spaces? –  Jeff Atwood Oct 6 '11 at 0:34
    
done @JeffAtwood –  waffles Oct 6 '11 at 0:55
    
I'm somewhat curious as to whether this question trips the "haven't indented code properly" trigger, or whether it subsequently tripped some other quality control mechanism. –  Andrew Grimm Oct 6 '11 at 1:35
    
I forsee another FAQ entry, a la meta.stackexchange.com/questions/86997/… and meta.stackexchange.com/questions/92074/…. –  Pops Oct 6 '11 at 13:55
    
@Pops, that FAQ never happened, did it? Failed to find anything close today (but seeing enough questions that could have been closed with a reference to such FAQ). –  Arjan Nov 10 '13 at 14:47
    
@Arjan as far as I know, no, it didn't. But considering how many people fail to read the posts I linked, maybe it's a good thing that nobody expended the time and effort. (Granted, I don't know how many people do read the linked posts.) –  Pops Nov 10 '13 at 16:13
    
Fun fact, @Pops, here are some old numbers for at least following the old link to the "No longer accepting questions" help. But I guess you're right, not worth the effort... –  Arjan Nov 10 '13 at 18:11
    
@Arjan nice! Now if only Google could tell us how many of those people stopped paying attention immediately after realizing that there was no "CLICK HERE TO END YOUR BAN" button on that page.... –  Pops Nov 10 '13 at 22:18
add comment

1 Answer

Maybe Stack Overflow interprets all of your "i"s as variables:

i really confused about write Ask Question in stackoverflow, i have indent all my code by 4 space but after i click post question button i always get error

Oops! Your question couldn't be submitted because: Your post appears to contain code that is not properly formatted as code. Please indent all code by 4 spaces using the code toolbar button or the CTRL+K keyboard shortcut. For more editing help, click the [?] toolbar icon.

i really wanna cry. hmmm. now im cry.

Stack Overflow probably doesn't realize that you're incapable of capitalization, unless you've copied the text from elsewhere:

i really confused about write Ask Question in stackoverflow, i have indent all my code by 4 space but after i click post question button i always get error

Oops! Your question couldn't be submitted because: Your post appears to contain code that is not properly formatted as code. Please indent all code by 4 spaces using the code toolbar button or the CTRL+K keyboard shortcut. For more editing help, click the [?] toolbar icon.

i really wanna cry. hmmm. now im cry.

I hope you get a properly working keyboard soon!

Edit: I 95% joking about "i" being treated as a variable. I don't really know why your question couldn't be posted.

However, personally speaking, I don't like questions with really bad grammar. Such questions don't merely indicate they're speaking English as a second language. It usually indicates that the person is either too rude to care about the readability of their question, or lack any interest in self-improvement, in English and usually their programming. Both categories of people are a turn-off to answering their question.

If you want to continue participating in Stack Overflow, consider reading How to ask a smart question and What’s the best way to ask a question if English isn't your first language? . And improve the quality of your questions. Not merely enough to avoid the automatic filters, but by a lot, so that your questions are actually a positive contribution to Stack Overflow.

If you wish to ask low quality questions somewhere other than on Stack Overflow (or other Stack Exchange web sites), I won't mind.

share|improve this answer
    
When I supply katakana or hiragana in my Japanese Stack Exchange questions, I copy and paste them from other web sites. –  Andrew Grimm Oct 5 '11 at 22:27
3  
i suspect you are right. im cry –  waffles Oct 6 '11 at 0:42
4  
it's his question and he'll cry if he wants to. –  user7116 Oct 6 '11 at 1:09
add comment

You must log in to answer this question.