収音のボタンの処理を書きました。
1 parent 024ab61 commit 2bdf69c458014459e1c01c660eb0232fe011b13b
m-shindo authored on 10 Nov 2020
Showing 1 changed file
View
38
app/src/main/java/org/ntlab/amaryllis/client/MainActivity.java
import android.provider.Settings;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.ImageButton;
import android.widget.Toast;
 
import com.google.android.material.bottomnavigation.BottomNavigationView;
 
private ArrayList<LocationListener> listeners = new ArrayList<>();
private HashMap<String ,Category> categories;
ArrayList<String> checkedList = new ArrayList<>();
HashMap<Integer,String> menuItemMap = new HashMap<>();
ImageButton playbutton;
ImageButton stopbutton;
ImageButton skipbutton;
 
int playfrag=0;
int stopfrag=0;
 
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
 
});
 
//収音関係のボタンの処理
playbutton = (ImageButton)findViewById(R.id.playbutton);
playbutton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
playfrag++;
if((playfrag%2)==0){
//こっち側がオフ
}else{
//こっち側がオン
}
}
});
stopbutton = (ImageButton)findViewById(R.id.stopbutton);
stopbutton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
stopfrag++;
if((stopfrag%2)==0){
//こっち側がオフ
}else{
//こっち側がオン
}
}
});
skipbutton = (ImageButton)findViewById(R.id.skipbutton);
skipbutton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
 
}
});
 
 
LocationManager manager = (LocationManager) getSystemService(LOCATION_SERVICE);
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
return;