compose: details: Setup menu
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
@@ -32,6 +32,7 @@ import android.graphics.Color
|
||||
import android.os.Bundle
|
||||
import android.os.Environment
|
||||
import android.os.PowerManager
|
||||
import android.provider.Settings
|
||||
import android.util.Log
|
||||
import android.util.TypedValue
|
||||
import android.view.LayoutInflater
|
||||
@@ -60,6 +61,17 @@ fun Context.browse(url: String) {
|
||||
}
|
||||
}
|
||||
|
||||
fun Context.appInfo(packageName: String) {
|
||||
try {
|
||||
val intent = Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS).apply {
|
||||
data = "package:$packageName".toUri()
|
||||
}
|
||||
startActivity(intent)
|
||||
} catch (exception: Exception) {
|
||||
Log.e(TAG, "Failed to open app info", exception)
|
||||
}
|
||||
}
|
||||
|
||||
fun Context.share(app: App) {
|
||||
try {
|
||||
val sendIntent = Intent().apply {
|
||||
|
||||
Reference in New Issue
Block a user