Ich versuche, einen Ordner in Android-SD-Karte zu erstellen ... Dafür habe ich die Erlaubnis in Manifest-Datei hinzugefügt und My dies mein Code ..Lenovo ermöglicht nicht Ordner in SD-Karte erstellen
public void createFile(View view)
{
String state= Environment.getExternalStorageState();
if(Environment.MEDIA_MOUNTED.equals(state)){
File wallpaperDirectory = new File("/sdcard/Wallpaper/");
res=wallpaperDirectory.mkdir()
if(res){
Toast.makeText(this, "Success", Toast.LENGTH_SHORT).show();
}
else{
Toast.makeText(this, "Failed", Toast.LENGTH_SHORT).show();
}
}
else{
Toast.makeText(this, "Make sure that you have a memory card mounted...", Toast.LENGTH_SHORT).show();
}
}
Wenn ich den gleichen Code in kitkat Emulator seiner Erstellung Ordner lief aber Sein immer Spruch in lenovo gescheitert ... Vielen Dank im Voraus ...
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="bk.acs">
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".SubActivity1"></activity>
</application>
</manifest>
Haben Sie Karte in Ihrem Gerät sd –
Ja, ich habe ..wenn nicht, daß ich es Toast geben sollte dann SD-Karte haben, wie sicher bla bla Make .. – bharath
kann –