일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- 삼성소프트웨어멤버십
- CNN
- LSTM
- javascript
- Lotto
- GT-S80
- Series
- Numpy
- install
- dataframe
- keras
- pycharm
- RNN
- mariadb
- 알고리즘
- ipad
- Button
- synology
- mean
- Python
- SciPy
- GitHub
- pip
- Splunk
- DFS
- E-P1
- imread
- pandas
- index
- SPL
Archives
- Today
- Total
잠토의 잠망경
Test Android Source Code 본문
http://www.planetb.ca/projects/syntaxHighlighter/
위에 Site에서 해당 Code를 syntaxHighlight 했습니다.
Exploer를 사용하여 Copy를 할 경우 tab key가 사라지는데
chrome을 사용할 경우 아래와 같이 정상적으로 나오네요. ㅜㅜ;
뭔지는 모르지만 chrome을 사용하기 때문에 그냥 넘어가봅니다. ㅋ
[chrome]
- package com.example.chapter07_01;
- import android.os.Bundle;
- import android.app.Activity;
- import android.view.Menu;
- import android.view.MenuInflater;
- import android.view.MenuItem;
- import android.widget.Toast;
- public class MainActivity extends Activity {
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
- }
- @Override
- public boolean onCreateOptionsMenu(Menu menu) {
- // Inflate the menu; this adds items to the action bar if it is present.
- //MenuInflater inflater = getMenuInflater();
- //inflater.inflate(R.menu.menu, menu);
- super.onCreateOptionsMenu(menu);
- MenuItem item1 = menu.add(0,R.id.new_game,0,"new game");
- item1.setIcon(R.drawable.new_game);
- item1.setAlphabeticShortcut('a');
- MenuItem item2 = menu.add(0,R.id.quit,0,"cancel");
- item2.setIcon(R.drawable.quit);
- item2.setAlphabeticShortcut('b');
- return true;
- }
- @Override
- public boolean onOptionsItemSelected(MenuItem item)
- {
- switch(item.getItemId())
- {
- case R.id.new_game:
- Toast.makeText(this, "Selected new Game", Toast.LENGTH_SHORT).show();
- return true;
- case R.id.quit:
- Toast.makeText(this, "Selected quit", Toast.LENGTH_SHORT).show();
- return true;
- default: return super.onOptionsItemSelected(item);
- }
- }
- }
[explorer]
-
package com.example.chapter07_01;
-
-
import android.os.Bundle;
-
import android.app.Activity;
-
import android.view.Menu;
-
import android.view.MenuInflater;
-
import android.view.MenuItem;
-
import android.widget.Toast;
-
-
public class MainActivity extends Activity {
-
-
@Override
-
protected void onCreate(Bundle savedInstanceState) {
-
super.onCreate(savedInstanceState);
-
setContentView(R.layout.activity_main);
-
}
-
-
@Override
-
public boolean onCreateOptionsMenu(Menu menu) {
-
// Inflate the menu; this adds items to the action bar if it is present.
-
//MenuInflater inflater = getMenuInflater();
-
//inflater.inflate(R.menu.menu, menu);
-
-
super.onCreateOptionsMenu(menu);
-
-
MenuItem item1 = menu.add(0,R.id.new_game,0,"new game");
-
item1.setIcon(R.drawable.new_game);
-
item1.setAlphabeticShortcut('a');
-
-
MenuItem item2 = menu.add(0,R.id.quit,0,"cancel");
-
item2.setIcon(R.drawable.quit);
-
item2.setAlphabeticShortcut('b');
-
-
return true;
-
}
-
-
-
@Override
-
public boolean onOptionsItemSelected(MenuItem item)
-
{
-
switch(item.getItemId())
-
{
-
case R.id.new_game:
-
Toast.makeText(this, "Selected new Game", Toast.LENGTH_SHORT).show();
-
-
return true;
-
case R.id.quit:
-
Toast.makeText(this, "Selected quit", Toast.LENGTH_SHORT).show();
-
-
return true;
-
default: return super.onOptionsItemSelected(item);
-
}
-
-
}
-
-
}
Comments