I have problem when answering or asking questions on StackOverflow
Suppose I have two possible code snippets and I want to ask which is better.
Here is code 1:
@Override
protected void onCreate(Bundle savedInstanceState) {
// my code here
}
and here is code 2:
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// my code here
}
You may notice that I can put the code in code snippet block But this is not possible if I add Bulleted list just before this code snippet, Like this:
Here is code 1
@Override protected void onCreate(Bundle savedInstanceState) { // my code here }
Here is code 2
@Override public boolean onCreateOptionsMenu(Menu menu) { // my code here
}
Now, no matter what I try I cannot format my code in code snippet form, even without the short cut ctrl + k.
You can even check and try to edit this question attempting to put the code in code snippet.
Moreover if I have say 30 line of code, the ctrl + K destroys the formatting of code instead of putting in code snippet.
It literally means that if have bulleted list as your first statement in your question/answer you cannot add code snippet.
So,
- Is this a known bug?
- Is there any alternative to put code in code snippet. If yes, then how?