This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { | |
super.onActivityResult(requestCode, resultCode, data) | |
if (requestCode == REQ_CODE && resultCode == Activity.RESULT_OK) { | |
val intent = Intent(this, MyService::class.java) | |
intent.data = uri | |
intent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION) | |
startService(intent) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private fun overwriteImages(uris: List<Uri>) { | |
val pendingIntent = MediaStore.createWriteRequest(contentResolver, uris) | |
startIntentSenderForResult(pendingIntent.intentSender, REQ_CODE, null, 0, 0, 0) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private fun deleteImages(uris: List<Uri>) { | |
val pendingIntent = MediaStore.createDeleteRequest(contentResolver, uris.filter { | |
checkUriPermission(it, Binder.getCallingPid(), Binder.getCallingUid(), Intent.FLAG_GRANT_WRITE_URI_PERMISSION) != PackageManager.PERMISSION_GRANTED | |
}) | |
startIntentSenderForResult(pendingIntent.intentSender, REQ_CODE, null, 0, 0, 0) | |
} | |
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { | |
super.onActivityResult(requestCode, resultCode, data) | |
if (requestCode == REQ_CODE && resultCode == Activity.RESULT_OK) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import static org.junit.Assert.*; | |
import org.junit.After; | |
import org.junit.Before; | |
import org.junit.Test; | |
/** | |
* The test class MagicSquareTest. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Random; | |
/** | |
* Clase MagicSquare realizada para el ejercicio de seminario de IP | |
* | |
* @author Fernando | |
* @version | |
*/ | |
public class MagicSquare | |
{ | |
public static final int MAX_SIZE = 10; |
NewerOlder