假设我使用and intent(MediaStore.ACTION_IMAGE_CAPTURE)编写了一个相机应用程序,我注意到当我运行应用程序时,选项菜单显示“编辑快捷方式”,我如何添加到此选项菜单或完全覆盖选项菜单到我自己的?
以下是我的代码片段:
public class GPSCam extends Activity implements LocationListener,
GpsStatus.Listener {
private Intent camIntent;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_gpscam);
...
...
this.startCamera();
}
protected void startCamera() {
...
// create camera intent
camIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
// define where to keep the photo
camIntent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
// this method will call onActivityResult() upon finishing an activity
// i.e. image captured
startActivityForResult(camIntent, CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE);
}
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE) {
if (resultCode == RESULT_OK) {
...
...
...
} }
答案 0 :(得分:1)
您无法修改其他应用程序的选项菜单。如果您不想使用其他应用程序拍照,欢迎您使用Camera
对象并自己拍照。