Skip to content

Commit

Permalink
added MainActivity.kt
Browse files Browse the repository at this point in the history
  • Loading branch information
ishara-madu committed Jan 1, 2025
1 parent beb739c commit b1c5be2
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ android {
applicationId = "com.pixeleye.lteonly"
minSdk = 24
targetSdk = 34
versionCode = 1
versionName = "1.0"
versionCode = 2
versionName = "1.1"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/java/com/pixeleye/lteonly/AdActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ import com.google.android.gms.ads.FullScreenContentCallback

class AdActivity : Application(), Application.ActivityLifecycleCallbacks, LifecycleObserver {

private val AD_UNIT_ID: String = "ca-app-pub-3679572083540798/9526000257"
private val AD_UNIT_ID: String = "ca-app-pub-3940256099942544/9257395921"
// private val AD_UNIT_ID: String = "ca-app-pub-3679572083540798/9526000257"
private var currentActivity: Activity? = null
private lateinit var appOpenAdManager: AppOpenAdManager

Expand Down
12 changes: 7 additions & 5 deletions app/src/main/java/com/pixeleye/lteonly/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ class MainActivity : AppCompatActivity() {
openRadioInfo()
}

findViewById<Button>(R.id.help).setOnClickListener{
val intent = Intent(this,HelpActivity::class.java)
findViewById<Button>(R.id.help).setOnClickListener {
val intent = Intent(this, HelpActivity::class.java)
startActivity(intent)
}

Expand All @@ -46,15 +46,17 @@ class MainActivity : AppCompatActivity() {


private fun openRadioInfo() {
val intent = Intent(Intent.ACTION_MAIN)
intent.component = ComponentName("com.android.settings", "com.android.settings.RadioInfo")
val intent = Intent().apply {
component = ComponentName("com.android.settings", "com.android.settings.RadioInfo")
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) // Add this flag to ensure it's started as a new task
}
try {
startActivity(intent)
} catch (e: Exception) {
e.printStackTrace()
Toast.makeText(this, "RadioInfo page not accessible.", Toast.LENGTH_SHORT).show()
}
}


}

2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[versions]
agp = "8.6.1"
agp = "8.7.3"
kotlin = "1.9.0"
coreKtx = "1.15.0"
junit = "4.13.2"
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Dec 16 00:35:21 IST 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit b1c5be2

Please sign in to comment.