Ajout fonction appel téléphone radio
This commit is contained in:
@@ -3,8 +3,8 @@ package fr.svpro.radiomercure;
|
||||
import android.Manifest;
|
||||
import android.app.Dialog;
|
||||
import android.app.DownloadManager;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.res.Configuration;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
@@ -33,6 +33,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
private TextView tv_close;
|
||||
private TextView tv_version;
|
||||
private static String versionName;
|
||||
private static final String NUMERO_TEL_RADIO = "0375411456";
|
||||
|
||||
static {
|
||||
versionName = BuildConfig.VERSION_NAME;
|
||||
@@ -156,6 +157,12 @@ public class MainActivity extends AppCompatActivity {
|
||||
dialog.show();
|
||||
return true;
|
||||
|
||||
case R.id.tel:
|
||||
Intent intent = new Intent(Intent.ACTION_DIAL);
|
||||
intent.setData(Uri.parse("tel:" + NUMERO_TEL_RADIO));
|
||||
startActivity(intent);
|
||||
return true;
|
||||
|
||||
default:
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
@@ -10,6 +10,11 @@
|
||||
android:id="@+id/refresh"
|
||||
android:title="@string/menu_reload" />
|
||||
|
||||
<item
|
||||
android:id="@+id/tel"
|
||||
android:icon="@android:drawable/stat_sys_phone_call"
|
||||
android:title="@string/menu_phone"
|
||||
app:showAsAction="ifRoom" />
|
||||
<item
|
||||
android:id="@+id/exit"
|
||||
android:icon="@android:drawable/ic_lock_power_off"
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<resources>
|
||||
<string name="app_name">Radio Mercure</string>
|
||||
<string name="menu_exit">Quitter</string>
|
||||
<string name="menu_phone">Appeler la Radio</string>
|
||||
<string name="menu_reload">Relancer...</string>
|
||||
<string name="menu_about">A Propos...</string>
|
||||
<string name="dialog_close">Fermer</string>
|
||||
|
||||
Reference in New Issue
Block a user