Aller au contenu
View in the app

A better way to browse. Learn more.

Forum de Frandroid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Ajout de photo sur la SD card

Featured Replies

Posté(e)

Bonjour,

Je fais actuellement une application d'album photo. Cependant, j'aimerai qu'il soit possible d'ajouter nos photos (stockés sur la SD card) dans mon application. Pour cela, encore faut-il qu'il existe des photos ...

Ainsi, j'essaye donc d'insérer des photos "à la main", afin de tester mon ajout de photos.

Je tourne un peu en rond. Si quelqu'un peut m'aider, s'il vous plait, voici mon code :

public void initMediaStore() {

File fi = Environment.getExternalStorageDirectory();

if (!fi.mkdirs()) {
if (fi.exists()) {
} else {
Toast.makeText(AlbumViewActivity.this, "Folder error", Toast.LENGTH_SHORT).show();
return;
}
}
try {
MediaStore.Images.Media.insertImage(getContentResolver(), fi.getAbsolutePath(), "lapin_mignon", "lapin_mignon");
} catch (FileNotFoundException e) {
e.printStackTrace();
}

Actuellement, j'ai l'erreur : "java.io.FileNotException: /mnt/sdcard : open failed : EISDIR (Is a directory)."

Autres :

- La SD card a une taille dans l'emulateur.

- Permission : <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

- API lvl 16.

Merci d'avance.

Rejoignez la conversation

Vous pouvez poster maintenant et vous enregistrez plus tard. Si vous avez un compte, connectez-vous maintenant pour poster.

Invité
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Répondre à ce sujet…

Account

Navigation

Rechercher

Rechercher

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.