일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- html id
- #C++ has~a
- html object
- #C++ 연산자함수오버로딩
- relative path
- mac terminal command
- #binary
- #다차원포인터
- #CallByAddress
- html charset
- #1차원배열
- #자바상속#자바이즈어#is~a
- docker example
- html5 new tag
- border-box
- git flow
- 하이퍼레저패브릭
- 토큰경제
- html multimedia
- #성적관리프로그램
- html video
- #JAVASCRIPT
- #android activity
- hyperledger transaction
- html code
- #bubbleSort
- html youtube
- #2차원배열
- #3차원배열
- html plug-in
Archives
- Today
- Total
A sentimental robot
Menu 본문
package com.example.i310_54.myapplication08;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.os.CountDownTimer;
import android.os.Handler;
import android.os.Message;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.AttributeSet;
import android.util.Log;
import android.view.ContextMenu;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import java.util.Random;
public class MainActivity extends AppCompatActivity {
String TAG = "eun";
@Override
public boolean onContextItemSelected(MenuItem item) {
Log.d(TAG, "onContextItemSelected: "+item.getItemId());
return true;
}
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
super.onCreateContextMenu(menu, v, menuInfo);
menu.setHeaderTitle("Zoo");
menu.add(0, 1, 0, "tiger");
menu.add(0, 2, 0, "elephant");
menu.add(0, 3, 0, "rabbit");
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
LinearLayout li = findViewById(R.id.li);
registerForContextMenu(li); // layout을 꾹 누르면 메뉴 생성
}
}
'Android Studio' 카테고리의 다른 글
AsyncTask (0) | 2018.12.14 |
---|---|
Thread를 이용한 UI (0) | 2018.02.07 |
My xml (0) | 2018.02.06 |
Customizing (0) | 2018.02.06 |
OnTouch (0) | 2018.02.06 |