I using the following code:
String outputFile = "/mnt/sdcard/mydir/myApp.apk"
File f = new File(outputFile);
if(!f.exists())
f.createNewFile();
// *** other code ***
But when the application reaches the line
f.createNewFile();
nothing appens. The other code linees are not executed and no error occurs.
The activity from where I executed this code is configured in manfiest in this way:
<activity android:theme="@android:style/Theme.NoTitleBar"
android:name=".ACT_ImpostazioniAvanzate" android:screenOrientation="landscape">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="content" />
<data android:scheme="file" />
<data android:mimeType="application/vnd.android.package-archive" />
</intent-filter>
</activity>
This activity is not the main activity, and in the manifest I obtain the following Waring:
"Exported activity does not require permission"
What does this mean? May be related to my creation file problem?