divers
This commit is contained in:
@@ -9,6 +9,7 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.ServiceConnection;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.media.MediaPlayer;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
@@ -33,7 +34,6 @@ public class MainActivity extends AppCompatActivity {
|
||||
private static final int WRITE_EXTERNAL_STORAGE_RC = 100;
|
||||
private WebView web;
|
||||
private String url, userAgent, contentDisposition, mimeType;
|
||||
private Menu menu;
|
||||
private Dialog dialog;
|
||||
private TextView tv_close;
|
||||
private TextView tv_version;
|
||||
@@ -150,6 +150,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
return super.onCreateOptionsMenu(menu);
|
||||
}
|
||||
|
||||
@SuppressLint("UseCompatLoadingForDrawables")
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
||||
int id = item.getItemId();
|
||||
@@ -176,11 +177,6 @@ public class MainActivity extends AppCompatActivity {
|
||||
|
||||
case R.id.live:
|
||||
lectureAudio("https://live.radiomercure.fr/on-air/live");
|
||||
|
||||
/* Intent playerIntent = new Intent(this, MediaPlayerService.class);
|
||||
startService(playerIntent);
|
||||
bindService(playerIntent, serviceConnection, Context.BIND_AUTO_CREATE);*/
|
||||
|
||||
return true;
|
||||
|
||||
default:
|
||||
@@ -216,6 +212,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
}
|
||||
};
|
||||
|
||||
@SuppressLint("UseCompatLoadingForDrawables")
|
||||
private void lectureAudio(String chemin) {
|
||||
//Check is service is active
|
||||
if (!serviceBound) {
|
||||
@@ -223,7 +220,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
playerIntent.putExtra("media",chemin);
|
||||
startService(playerIntent);
|
||||
bindService(playerIntent, serviceConnection, Context.BIND_AUTO_CREATE);
|
||||
} else {
|
||||
} else {
|
||||
//Toast.makeText(player, "OK", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user