diff --git a/app/src/main/java/org/ntlab/amaryllis/client/fragment/MapsFragment.java b/app/src/main/java/org/ntlab/amaryllis/client/fragment/MapsFragment.java index ae5a535..9cdd14d 100644 --- a/app/src/main/java/org/ntlab/amaryllis/client/fragment/MapsFragment.java +++ b/app/src/main/java/org/ntlab/amaryllis/client/fragment/MapsFragment.java @@ -90,6 +90,7 @@ private int SeekChange = 1; private int StopChange = 0; private int count = 0; + private Location loc; File file; static final String filePath = Environment.getExternalStorageDirectory() + "/sample.3gp"; Button RecordButton; @@ -221,14 +222,20 @@ // file = new File(getFilesDir(),"Sample.3gp"); mp = new MediaPlayer(); - RecordButton = (Button) view.findViewById(R.id.button); - RecordButton.setOnClickListener(new View.OnClickListener() { - public void onClick(View v) { - //Intent intent = new Intent(getActivity(), VoiceActivity.class); - //startActivity(intent); - startRecord(); - } - }); + + RecordButton = (Button) view.findViewById(R.id.button); + RecordButton.setOnClickListener(new View.OnClickListener() { + public void onClick(View v) { + if(loc != null) { + //Intent intent = new Intent(getActivity(), VoiceActivity.class); + //startActivity(intent); + startRecord(); + }else{ + System.out.println("onLocationChangedが起動していません。"); + } + } + }); + PlaybackButton = (Button) view.findViewById(R.id.button2); PlaybackButton.setOnClickListener(new View.OnClickListener() { @@ -256,6 +263,7 @@ @Override public void onLocationChanged(Location location) { category = ((MainActivity) getActivity()).getCheckedCidList(); + loc=location; if(category.size() != before_category) { for(Marker marker : mMarker) { marker.remove(); @@ -415,6 +423,8 @@ Amaryllis amaryllis = (Amaryllis) getActivity().getApplication(); amaryllis.setData(data); + amaryllis.setLocation(loc); + // Call call = voicememosService.postVoicememos(amaryllis.getUid(),amaryllis.getToken(),10,data,35,135,"untitled",""); // call.enqueue(new Callback() {