Android 的选项菜单OptionsMenu和上下文菜单ContextMenu的使用案例
1、选项菜单OptionsMenu和上下文菜单ContextMenu 效果如下: 2、MainActivity package com.example.aidldemo; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.ContextMenu; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.widget.TextView; import android.widget.Toast; public class Main3Activity extends AppCompatActivity { private TextView tv; @Override protected void onCreate(Bundle savedInstanceState) { super .onCreate(savedInstanceState); setContentView(R